Easy Way – Adding Facebook Like to WordPress

Auto Date May 26th

Been working hard on our blog lately and wanted to add in some article sharing tools. We decided to use AddThis. They make it very easy to add 286 services (at current count)!

We kept it to the most common sharing services: Twitter, Facebook, Email, Print and a new one Facebook Like. It really is as simple as adding a few lines of code to your WordPress pages.

We inserted the following code in to our Single Post page:

<!– AddThis Button BEGIN –>
<?php echo “<div class=\”addthis_toolbox addthis_default_style\” addthis:url=\”".get_permalink().”\” addthis:title=\”".htmlspecialchars(get_the_title($id)).”\”>
<a class=\”addthis_button_twitter\”></a>
<a class=\”addthis_button_facebook\”></a>
<a class=\”addthis_button_email\”></a>
<a class=\”addthis_button_print\”></a>
<a class=\”addthis_button_facebook_like\”></a>
</div>
<script type=\”text/javascript\” src=\”http://s7.addthis.com/js/250/addthis_widget.js#username=xxxxx\”></script>”; ?>
<!– AddThis Button END –>

(NOTE: replace username=xxxxx with your actual AddThis username.)

You get this:

The Farm Blog with Facebook Like

That is it! Adding Facebook Like is dead simple using WordPress and AddThis.


blog comments powered by Disqus