WordPress Facebook like button plugin doesn’t show on category and tag pages

17 Mar ’11

in Coding,Wordpress

I’m using this one:

FaceBook Like Button Plugin for WordPress

by http://healyourchurchwebsite.com/2010/04/22/the-facebook-like-button-plugin-for-wordpress/

But there in one limitation. It doesn’t show the button on the category archive view and on the tag archive view pages. Probably in some cases it is good, but in others it’s better to show it.

So in order to do this go to the plugin files and open fblike_content_filter.php

On line 12 there is:

if(     (is_front_page() && $fblike_settings_show_on_front_page == 'true') ||
 (is_single() && $fblike_settings_show_on_single_post == 'true') ||
 (is_page() && $fblike_settings_show_on_single_page == 'true') )
 {

Add two more lines so it will become like this:

if(     (is_front_page() && $fblike_settings_show_on_front_page == 'true') ||
 (is_single() && $fblike_settings_show_on_single_post == 'true') ||
 (is_category() && $fblike_settings_show_on_front_page == 'true') ||
 (is_tag() && $fblike_settings_show_on_front_page == 'true') ||
 (is_page() && $fblike_settings_show_on_single_page == 'true') )
 {

Additional info on the WordPress conditional tags can be found here:
http://codex.wordpress.org/Conditional_Tags

{ 1 comment… read it below or add one }

Jay Na September 16, 2011 at 5:03 am

Thank you so much, you’re a genius.
P.S. it works similarly on other Facebook like plugins too.
Copy the format and attribute “front” to is_category and is_tag

Reply

Leave a Comment

 

Previous post:

Next post: