How to add like/recommend Facebook button to wordpress



Yesterday Facebook announced a new set of social plugins. Here’s the code to put the like/recommend button directly in your Wordpress posts. It’s very easy, just cut and paste this code into Single Post (single.php) in the theme editor:


<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show_faces=true&amp;width=450
&amp;action=recommend&amp;font=verdana&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>

I would recommend to place it right after the post, just before the comments, which on my wordpress is the line just before

<?php comments_template(); ?>

You may visit facebook Like button to customize it further. Just remember to change, in the code provided there, the “URL to like” with < ?php echo urlencode(get_permalink()); ?> right after the ?href= and right before the & amp;

Have you found this useful? You may want to recommend it ;-)
Any questions? Comment below pls.

0 commenti ↓

Non ci sono ancora commenti a questo articolo; inizia una discussione! Inserisci un commento usando il form qui sotto.

Lascia un Commento