Quickly add Social Share Buttons to your WordPress site without plugin

/, WordPress/Quickly add Social Share Buttons to your WordPress site without plugin

Quickly add Social Share Buttons to your WordPress site without plugin

Hello,

I’m not going to spend much on telling you why you should add social share buttons to your website or anything else. Getting to the job right away. So this snippet includes simple Facebook Like, Facebook Share, Tweet, Google +1 and Pin It buttons.

Lets start!

First lets open header.php, footer.php and functions.php files from your template folder.

In functions.php file insert the following code:

[php]

function socialShare(){
?>



[/html]

Where the XXXXXXXXX needs to be changed with your appID. For additional information check the FB Like button page.

Now we need to initialize the scripts for Pinterest and Google +1. Open footer.php and paste the code from the box below (I usually place it after  wp_footer())

[html]


[/html]

And you are ready! Every time you insert socialShare(); in your template it will call the buttons.

By | 2017-02-12T17:48:49+00:00 February 12th, 2017|Snippets, WordPress|0 Comments

Leave A Comment