WordPress Facebook Like Plugin Pages Hack
Written by Zain on March 27th, 2011{ 7 comments }
I’ve recently been building my own NLP Life Coach site. And yes, I’ve been using all the WordPress skills I’ve acquired from building sites for other people the last few years. Very handy! It’s been quite a task, mainly as I probably know too much and spend far too much time tweaking things so they’re just right rather than getting any content together… Anyway, I’ve just published my very first NLP Life Coach podcast called “2011: A Retrospective Of A Wonderful Year Ahead”. (Have a listen – it’s pretty bloody good. Even if I do say so myself… and I do!).
As I sat and admired my handiwork, I noticed something missing. Yes, I’m using the all the SEO tricks I possibly can. I even found this nifty little WordPress Facebook Like plugin (by AJ Batac) to use on the site. I like it. It has those pictures of people you know appearing under the “Like” button – not like the one I’m using on this site. Cool.
…but, here’s the problem:
“The WordPress Facebook Like plugin doesn’t work with Pages!”
Not good. I’m quite proud of the jQuery tabs on my NLP Life Coach Contact page on my new site. It would be nice if people “Liked” it. Or had the option to! For some reason, this option isn’t built into the plugin.
Nuts.
But it’s okay folks… I got another WordPress Hack to fix this page issue. And it’s simple too! So here it is:
The WordPress Facebook Like Plugin Pages Hack
Important: Always remember to make a backup of any files you edit! You have been warned.
- In WordPress, click on Plugins / Editor.
- For “Select plugin to edit:“, choose the WordPress Facebook Like plugin and click Select.
Alternatively,
you can use your favourite editor and open:
/wp-content/plugins/wordpress-facebook-like-plugin/Wordpress-Facebook-Like-Plugin.php - Look for the following on line 198:
if( !is_feed() && !is_page() && !is_archive() && !is_search() && !is_404() )
- Change it to read:
if( !is_feed() && !is_archive() && !is_search() && !is_404() )
- Click the blue “Update File” button and save the file.
- You’re done!
All that’s really been done here is to remove the !is_page() function so the plugin doesn’t look to exclude it from Pages.
When you check your Pages, you should now see that you have the WordPress Facebook Like plugin working on Pages!
Improving the WordPress Facebook Like plugin
Having looked at the code, it wouldn’t take much to add something like this:
<h2>Posts & Pages Setting</h2>
<div>The Post Type of the plugin (Default: Posts)</div>
<select name=”wp_fb_like_posttype” id=”wp_fb_like_posttype”>
<option value=”post” <?php if (get_option(“wp_fb_like_posttype”) == “post”) echo ‘selected’; ?>>Posts</option>
<option value=”pages” <?php if (get_option(“wp_fb_like_posttype”) == “pages”) echo ‘selected’; ?>>Pages</option>
<option value=”both” <?php if (get_option(“wp_fb_like_posttype”) == “both”) echo ‘selected’; ?>>Both</option>
</select>
to make another option, then have a few conditional statements so people could select what they’d prefer to output.
…but I’ll leave that to AJ Batac to update!
For the moment, it’s worthwhile checking out the WordPress Facebook Like plugin. Even if you do need to use it on Pages, a slight code tweak and it can be easily done.
Enjoy!




May 4th, 2011 at 9:25 am
I appreciate your post! I am trying to create a website similar. I have been reading a lot and found WordPress Facebook Like Plugin Pages Hack · « KnowledgeConstructs.com … thanks again!
June 22nd, 2011 at 3:24 pm
Thank you. Thanks for sharing. nice web site
July 5th, 2011 at 12:31 am
Very nice and informatinve article…I have been looking for this info past four days…thank you.
December 22nd, 2011 at 6:31 pm
A web hosting chile service is a type of Internet hosting chile service that allows individuals and organizations to make their
own website (hosting chile) accessible via the World Wide Web. Web hosting chile are companies that provide space on a server they own or
lease for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts (hosting Chile) can
also provide data center space and connectivity to the Internet for servers they do not own to be located in their
data center, called colocation or Housing as it is commonly called in hosting chile.
February 7th, 2012 at 12:01 pm
Hey There Knowledgeconstructs,
In addition to your post I was wondering, Even if I have been involved with Twitter from soon upon you’ll find it kick off there is so a good deal to find out. Families arrive up with varied methods to use Twitter to market place and establish a group of consumers and this is 1 magnificent spot of Twitter to stick to. The other space of Twitter that is equally as very good is all the plugins and hacks that are created to make the full Twitter practical experience way more and a lot of distinctive.
Nice One!
March 10th, 2012 at 6:48 pm
Like dogs inside a wheel, birds inside a cage, or squirrels in a chain, ambitious men still climb and climb, with great labor, and incessant anxiety, but never attain the top.
It is not everything you pay a man, but what he costs you that counts.
March 30th, 2012 at 5:25 pm
Boost your webtraffic by exchanging Facebook Likes, Google +1, Twitter Followers or Website visitors…
[...]WordPress Facebook Like Plugin Pages Hack · « KnowledgeConstructs.com[...]…