Tutorial: Add a FB Like button to WP3.5
-
Hello! Good tutorial. For those of you trying to get rid of the text on the right of the button and just go with a like button and view count I have the solution. for you. After extensive research and only after playing around with the code was able to remove the text on the right of the button by using this method.
1. Add this code right after <body <?php body_class(); ?>> in header.php:
<div id=”fb-root”></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = “//connect.facebook.net/en_US/all.js#xfbml=1″; fjs.parentNode.insertBefore(js, fjs); }(document, ‘script’, ‘facebook-jssdk’));</script>
2. Add this code where you want the FB Like button to show up which is usually in single.php inside the loop.
<div class=”fb-like” data-layout=”button_count” data-send=”false” data-width=”100″ data-text=”false” data-show-faces=”false”></div>
This works on WordPress 3.5+ and Twenty Twelve.
The topic ‘Tutorial: Add a FB Like button to WP3.5’ is closed to new replies.