Created
June 14, 2017 15:46
-
-
Save DavidEngland/6bce74750ff71ece4544966090dd2683 to your computer and use it in GitHub Desktop.
General function for sharing webpage on social medias.
Pass name of the social media you want to share webpage on, or if you want to share a specific page from webpage then pass the url as 2nd argument. See examples for clarification.
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 characters
| <?php | |
| echo "<h3>Share current page</h3>"; | |
| echo '<a href="" class="" ' . socialLink( 'facebook' ) . '>Share on Facebook</a><br/>'; | |
| echo '<a href="" class="" ' . socialLink( 'twitter' ) . '>Share on Twitter</a><br/>'; | |
| echo '<a href="" class="" ' . socialLink( 'google' ) . '>Share on Google</a><br/>'; | |
| echo "<h3>Share specific url</h3>"; | |
| echo '<a href="" class="" ' . socialLink( 'facebook', 'www.worthers.com' ) . '>Share on Facebook</a><br/>'; | |
| echo '<a href="" class="" ' . socialLink( 'twitter' , 'www.worthers.com' ) . '>Share on Twitter</a><br/>'; | |
| echo '<a href="" class="" ' . socialLink( 'google' , 'www.worthers.com' ) . '>Share on Google</a><br/>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment