Last active
April 19, 2018 08:53
-
-
Save JacquesvanWyk/26463d0e5b18cf18b10372f090bd7f0f to your computer and use it in GitHub Desktop.
Revisions
-
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ I assume here you know how to get the button up and running if you dont please j We need to just make function calling the correct url when clicking share so go to your functions.php file and add this code: > `function myblog_post_by_slug($the_slug, $post_type = "page"){ $args = array( 'name' => $the_slug, 'post_type' => $post_type, -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ I assume here you know how to get the button up and running if you dont please j We need to just make function calling the correct url when clicking share so go to your functions.php file and add this code: `function myblog_post_by_slug($the_slug, $post_type = "page"){ $args = array( 'name' => $the_slug, 'post_type' => $post_type, @@ -20,7 +20,7 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ ); $my_page = get_posts($args)[0]; return $my_page; }` This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: > `data-href="<?php echo myblog_post_by_slug('map'); ?>"` -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,11 +24,11 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: > data-href="<?php echo myblog_post_by_slug('map'); ?>" ## Hope this helped if you got problems leave comment -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,8 +24,11 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: data-href="" inside double quotes add this <?php echo myblog_post_by_slug('map'); ?> ## Hope this helped if you got problems leave comment -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: data-href="<?php echo myblog_post_by_slug('map'); ?>" ## Hope this helped if you got problems leave comment -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function myblog_post_by_slug($the_slug, $post_type = "page"){ This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: // data-href="<?php echo myblog_post_by_slug('map'); ?>" ## Hope this helped if you got problems leave comment -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 18 additions and 74 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,88 +1,32 @@ # Share you Wordpress post with facebook using correct post url If you struggle to get the correct url for your share button here is a fix. ## Getting Started I assume here you know how to get the button up and running if you dont please just go to https://developers.facebook.com/docs/plugins/share-button and follow instructions ### Code to get the correct url shared We need to just make function calling the correct url when clicking share so go to your functions.php file and add this code: function myblog_post_by_slug($the_slug, $post_type = "page"){ $args = array( 'name' => $the_slug, 'post_type' => $post_type, 'post_status' => 'publish', 'numberposts' => 1 ); $my_page = get_posts($args)[0]; return $my_page; } This function will help get the slug of your current post now all you need to do is change the data-href(you get this in step 3 on facbebook developers) to this: data-href="<?php echo myblog_post_by_slug('map'); ?>" ## Hope this helped if you got problems leave comment -
JacquesvanWyk revised this gist
Apr 19, 2018 . 1 changed file with 88 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,88 @@ # Project Title One Paragraph of project description goes here ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. ### Prerequisites What things you need to install the software and how to install them ``` Give examples ``` ### Installing A step by step series of examples that tell you have to get a development env running Say what the step will be ``` Give the example ``` And repeat ``` until finished ``` End with an example of getting some data out of the system or using it for a little demo ## Running the tests Explain how to run the automated tests for this system ### Break down into end to end tests Explain what these tests test and why ``` Give an example ``` ### And coding style tests Explain what these tests test and why ``` Give an example ``` ## Deployment Add additional notes about how to deploy this on a live system ## Built With * [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used * [Maven](https://maven.apache.org/) - Dependency Management * [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds ## Contributing Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us. ## Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). ## Authors * **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth) See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details ## Acknowledgments * Hat tip to anyone who's code was used * Inspiration * etc -
JacquesvanWyk created this gist
Apr 19, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ function jvw_post_by_slug($the_slug, $post_type = "page"){ $args = array( 'name' => $the_slug, 'post_type' => $post_type, 'post_status' => 'publish', 'numberposts' => 1 ); $my_page = get_posts($args)[0]; return $my_page; }