Ahmed The Geek
Techno For Geeks
  • Home
  • Blog
  • Online Me
  • Live Show
  • About
  • Contact Me
  • Geeks Avenue
Select Page ...

Blog

Facebook Like Button for Wordpress V3

Ahmed April 30, 2010 Products 116 Comments

[VERSION 4.0][THIS  POST CLOSED CHECK V4 POST]

http://blog.ahmedgeek.com/facebook-like-button-for-wordpress-v4

[UPDATE 13/5/2010]

  • Multiple languages support (By: Anty (http://anty.at)).
  • Now you can change the font (By: Anty (http://anty.at)).
  • Code has been rewritten.
  • Database table removed, Replaced with options to avoid problems.

[UPDATE 8/5/2010]

  • og:site_name meta tag has been added to the header, So when somebody likes your post it’s going to appear on Facebook like this “User liked POSTNAME on SITENAME”.

Finally it’s here, V3… All features based on users requests :)

Features

  • Shortcut added to show the button manually. [more info]
  • Live preview in the settings section.
  • Option to hide in the home, pages or posts.
  • Bugs fixed.

You can add the button to your template by adding these 2 functions:

For the normal button:

if (function_exists('Short_Button')){ echo Short_Button(); }

For Count button:

if (function_exists('Count_Button')){ echo Count_Button(); }

Screenshot

Admin Setting Section

Download:

http://wordpress.org/extend/plugins/facebook-like-button/

← Facebook Like Plugin for WordPress V2.5
Write Your PHP Application in Professional Way →
avatar
Ahmed

My name is Ahmed Hussein aka Ahmed The Geek, i'm 20 years old guy from Cairo, Egypt. I'm a Computer Science Student, and working as a Senior Web Solutions Developer at Clicker DM. Hope you like my posts and feel free to contact me :).

116 Responses to Facebook Like Button for WordPress V3

  • avatar
    David
    5 / 13 / 2010

    Wow.. that was a quick solution. Works great!!!

    David 5 / 13 / 2010
  • avatar
    Lacy
    5 / 13 / 2010
    Ahmed

    Hi Ahmed,
    Has anyone else mentioned that in the settings they get a blank screen?

    Thanks,
    Lacy

    avatar

    Reply:
    May 13th, 2010 at 10:52 pm

    i sent you email :)

    Lacy 5 / 13 / 2010
  • avatar
    Aaqil Mahmood
    5 / 15 / 2010
    Ahmed

    Salam
    I liked your developing very much, kindly see this site http://max99.ninja.pk

    There when those people who LIKE, their avatars are half shown. is that bug?

    avatar

    Reply:
    May 15th, 2010 at 6:29 am

    Hi Aaqil,

    No it’s not a bug just change the height, if it’s 40 make it more.. or if it’s nothing, make it 40 and test it.. :)

    Aaqil Mahmood 5 / 15 / 2010
  • avatar
    Aaqil Mahmood
    5 / 15 / 2010

    Jazakallah for the quick response.

    70 height is for me it is superb now http://max99.ninja.pk/?p=421

    :) Thanks for the nice plugin.

    Aaqil Mahmood 5 / 15 / 2010
  • avatar
    Scott
    5 / 16 / 2010

    Hello, I’ve got a “Fatal error: Cannot redeclare class snoopy in /homez.167/websitename/www/wp-includes/class-snoopy.php on line 33″ wen I’m opening the settings window on this plug.
    Am I alone ?

    Scott 5 / 16 / 2010
  • avatar
    Liz
    5 / 17 / 2010

    I also see the error:

    Fatal error: Cannot redeclare class snoopy in /usr/local/pem/vhosts/164488/webspace/httpdocs/wp-includes/class-snoopy.php on line 33

    The plug in works on the site, but I can’t access the plug in settings page in my dashboard…

    Thanks.

    Liz 5 / 17 / 2010
  • avatar
    Liz
    5 / 17 / 2010

    Just to add, that was after your most recent update, which I updated automatically in wordpress 2.9.2

    Liz 5 / 17 / 2010
  • avatar
    Manogr
    5 / 19 / 2010
    Ahmed

    I also have the same fatal error as LIZ and can’t access the settings…

    avatar

    Reply:
    May 19th, 2010 at 6:56 pm

    @ Island Consulting

    This problem is caused by another plugin…

    @Scott, Liz, Manogr

    Sorry for being late, i had exams all the week… but i released update today,, it should solve the problem :)

    Cheers

    Manogr 5 / 19 / 2010
  • avatar
    Bryan
    5 / 19 / 2010

    Hi!
    Great Plugin!
    I had a question, when I ever someone pushes like on my website, cachesf.com, facebook does not post the title of the post. it just says bryan likes cachesf.com at cachesf.com

    how do i change this to show the title?

    thank you!

    Bryan 5 / 19 / 2010
  • avatar
    Kommentarsystem revolutioniert mit IntenseDebate und Facebook Like Button! | Buba weiß alles. Punkt!
    5 / 19 / 2010

    [...] das Ganze nun zu Nutze gemacht? Ich habe zwei Plugins neu installiert. Das eine nennt sich simpel “Facebook Like” und ist nicht unbedingt nötig, wenn man sich was mit HTML/CSS auskennt. Ich bin aber [...]

    Kommentarsystem revolutioniert mit IntenseDebate und Facebook Like Button! | Buba weiß alles. Punkt! 5 / 19 / 2010
  • avatar
    Facebook ??????? « ????
    5 / 20 / 2010

    [...] Facebook Like Button for WordPress ??????? ? WordPress ??????????? Facebook ?????????????????? [...]

    Facebook ??????? « ???? 5 / 20 / 2010
  • avatar
    Liz
    5 / 20 / 2010
    Ahmed

    Hey, thanks. The update fixed the settings problem. I noticed now that it’s very slow to load… wondering if that’s related? The site is http://nostupidanswers.com.

    Hope your exams went well :)

    avatar

    Reply:
    May 21st, 2010 at 2:04 pm

    Hi Liz,

    I don’t thing it’s related, it works for me fast and with no lag… :)

    Liz 5 / 20 / 2010
  • avatar
    Tony
    5 / 21 / 2010
    Ahmed

    One question: If you put it manually in the template as I do to avoid the duplication of the box? Thanks

    avatar

    Reply:
    May 23rd, 2010 at 7:44 pm

    @ Tony

    haha, i think i need to think about this :P ..

    @juggledad

    Done :)

    @Jason

    Can you provide screenshot ?

    @anty

    I would like to keep it secret at this point :)

    @vincent

    What version of php do you have?

    Tony 5 / 21 / 2010
  • avatar
    juggledad
    5 / 21 / 2010

    There is a bug in the code. The ‘Container Class’ doesn’t apply. You have to edit buttons.inc.php, after line 22 which is:
    ‘ht’ => ‘ht’, //Height Type px or em
    you must add
    ‘css’ => ‘css’, //Container Class name

    juggledad 5 / 21 / 2010
  • avatar
    Jason
    5 / 23 / 2010

    HI No matter what pages i try this on i get “could not be reached.”
    Tried XFBML as well, no luck
    any suggestions

    Jason 5 / 23 / 2010
  • avatar
    anty
    5 / 23 / 2010

    Can you elaborate what the API-keys and the activation-code in the latest update is all about?

    anty 5 / 23 / 2010
  • avatar
    vincent
    5 / 23 / 2010

    Hi i just updated from the 3.6 version (that worked properly) to the 3.8 that gives me that bug when i try to acrivate plugin:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/mhd-01/website/htdocs/wp-content/plugins/facebook-like-button/inc/activation.php on line 5

    vincent 5 / 23 / 2010
  • avatar
    vincent
    5 / 23 / 2010
    Ahmed

    version 4.4.4-8+etch6. server it’s not mine. can’t update phph version.
    where can i download again version 3.6?

    avatar

    Reply:
    May 23rd, 2010 at 9:40 pm

    You can download it from here: http://downloads.wordpress.org/plugin/facebook-like-button.3.6.zip
    :)

    vincent 5 / 23 / 2010
  • avatar
    Scott
    5 / 23 / 2010
    Ahmed

    Hello again, Ahmed :)

    You did two updates this last (2/3)days, and the first one solved my problem but the realy last update is giving me an other bug :s

    “Fatal error: Cannot redeclare class snoopy in /homez.167/gropix/www/wp-includes/class-snoopy.php on line 33″

    is it possible to have a link to download the v° juste befor please :s
    I did an otomaticupdate by mistak -_-’…

    That would be great :)
    (ans sorry for my english, Im french^^)

    avatar

    Reply:
    May 24th, 2010 at 12:24 am

    mmm weired, i didn’t change the code or anything :S :P

    You can download it from here: http://downloads.wordpress.org/plugin/facebook-like-button.3.6.zip :)

    Scott 5 / 23 / 2010
  • avatar
    Scott
    5 / 24 / 2010
    Ahmed

    Whene Im setting to the setting tab :

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homez.167/gropix/www/wp-content/plugins/facebook-like-button/inc/activation.php on line 5

    Realy sorry to be enoying :s

    avatar

    Reply:
    May 24th, 2010 at 6:27 am

    download 3.6 from the link in the last comment :)

    Scott 5 / 24 / 2010
  • avatar
    Scott
    5 / 24 / 2010

    3.6 is not working for me. But the 3.7 is ok :)

    Scott 5 / 24 / 2010
  • avatar
    Pablo
    5 / 25 / 2010
    Ahmed

    Hi,

    How can I manually position the plugin in my theme ??
    I tried if (function_exists('Short_Button')){ echo Short_Button(); } but nothing happens…

    Cheers

    avatar

    Reply:
    May 25th, 2010 at 7:56 pm

    @Pablo

    If guess you un-checked show in post, pages and home… Which is right but i missed that when i was writing the code :S.. Sorry will fix it today or tomorrow :)

    Pablo 5 / 25 / 2010
  • avatar
    Daniel Snyder
    5 / 25 / 2010
    Ahmed

    I installed this on my site and it works well, in terms of appearing below the post & functioning correctly, however the problem I am having is in the information it is sending to facebook. When a person clicks ‘like’ on a post, it simply posts my blog title & tagline to their wall, rather than the actual post title that they ‘liked’.
    Is there a way to ensure that the POST title is what is sent to facebook, NOT my blog name?
    Thanks

    avatar

    Reply:
    May 25th, 2010 at 7:57 pm

    Will contact Facebook and see what i can do :)

    Daniel Snyder 5 / 25 / 2010
  • avatar
    Jon Brown
    5 / 25 / 2010
    Ahmed

    I think there are a few bugs (I’m too new to php to be certain, so I say “think”) in 3.8

    First in buttons.inc.php ‘css’ is not included in the arrays for either Short_Button or Count_Button, but the code for both XFBML and iframe include:

    I’m not clear if ‘css’ was omitted because there were only to be used by people modifying their template (as I am) or if “‘ . $Value['css'] ‘” was accidentally copy/pasted into those functions.

    Second, using a div in $SDK makes it impossible to place the button inline with other elements, I’ve changed this to a span (actually I’ve changed all your divs to spans, but I don’t think all of them are necessary). Not so much a bug as a usability enhancement.

    Like I said up front I’m new to php hacking so I could be totally wrong… you clearly know WAY more then me so I apologize if I’m wrong on any of this.

    Thanks for the plug-in!

    avatar

    Reply:
    May 25th, 2010 at 8:04 pm

    @Jon..

    Actually you are right in everything, i thought i fixed the CSS thing :P … Will change the divs into spans next time.. And thanks for taking your time to write your feedback and suggestions… :)

    Jon Brown 5 / 25 / 2010
  • avatar
    Jan
    5 / 25 / 2010
    Ahmed

    Hi Ahmed,

    I’ve tried to use your 3.8 version of Like Button plugin. It shows me an error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/virtual_web/xawieur.cz/public_html/www/wp-content/plugins/facebook-like-button/inc/activation.php on line 5

    avatar

    Reply:
    May 25th, 2010 at 8:05 pm

    The problem is that you have PHP version 4 i guess, which soo old for the code. however you can install version 3.6 or 3.7 while i fix this problem :)

    Jan 5 / 25 / 2010
  • avatar
    Jon Brown
    5 / 25 / 2010

    @Ahemd – Thanks! Glad I could help and that I got things right.

    Jon Brown 5 / 25 / 2010
  • avatar
    Santiago Leon
    5 / 26 / 2010

    when the like icon is on the post, it gives a huge space area between the button and the post. What’s up with that please?

    Santiago Leon 5 / 26 / 2010
  • avatar
    Meme: Mis plugins de Wordpress | Save The Geek
    5 / 26 / 2010

    [...] Facebook Like: Otro plugin relacionado con Facebook, este nos permite añadir un “Me gusta” al final o principio de cada post. [...]

    Meme: Mis plugins de Wordpress | Save The Geek 5 / 26 / 2010
  • avatar
    Liz
    5 / 26 / 2010

    Help!!! Just updated to your latest, and the plugin cannot be activated:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /usr/local/pem/vhosts/164488/webspace/httpdocs/wp-content/plugins/facebook-like-button/inc/activation.php on line 5

    Liz 5 / 26 / 2010
  • avatar
    Tweaks and more | Life in the City
    5 / 26 / 2010

    [...] Facebook Like button [...]

    Tweaks and more | Life in the City 5 / 26 / 2010
  • avatar
    Kira
    5 / 26 / 2010

    Hi, there’s a huge white space below the button… how do i fix that?

    Kira 5 / 26 / 2010
  • avatar
    Kira
    5 / 26 / 2010
    Ahmed

    Hi Ahmed, i installed the plugin and it is working fine but there is a huge white space underneath the like button… it appears when i move the button above and below the content. how do i fix this? i’m using wp 2.9.2 and php5.

    avatar

    Reply:
    May 26th, 2010 at 8:14 pm

    hi Kira,

    Just change the height to 40px or as you like, until you get the best view :)

    Kira 5 / 26 / 2010
  • avatar
    Add Facebook “Like” Buttons to Your WordPress Blog – WordPress Plugins | AdsenseBay
    6 / 9 / 2010

    [...] the Facebook Like Button for WordPress for more [...]

    Add Facebook “Like” Buttons to Your WordPress Blog – WordPress Plugins | AdsenseBay 6 / 9 / 2010
  • avatar
    The Facebook Frenemy | Laura Keeley
    6 / 10 / 2010

    [...] the code is available directly from Facebook. I went the plugin route and used the one aptly titled Facebook Like. It’s hard to believe that the Facebook Like button has only proliferated the entire Internet [...]

    The Facebook Frenemy | Laura Keeley 6 / 10 / 2010
  • avatar
    How to See What People “Like” on Your Site with Facebook Insights | Angela Neal Media
    6 / 14 / 2010

    [...] a more visual person, try this YouTube tutorial from DuctTape Marketing.  Personally, I use the Facebook Like plug in for [...]

    How to See What People “Like” on Your Site with Facebook Insights | Angela Neal Media 6 / 14 / 2010
  • avatar
    Facebook Social Plugins & Their Impact on Your Website » The Molstad Consulting Blog
    6 / 14 / 2010

    [...] are also WordPress plugins available.  Try it out at the end of this [...]

    Facebook Social Plugins & Their Impact on Your Website » The Molstad Consulting Blog 6 / 14 / 2010
  • avatar
    Added Facebook Like « Clay Cook
    6 / 23 / 2010

    [...] was super easy to add with my hosted WordPress blog. Here is the Facebook Like plugin I used.   No [...]

    Added Facebook Like « Clay Cook 6 / 23 / 2010
« Older Comments
  • Find me on Facebook

  • Donate To The Geeks





  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 3 other subscribers

  • Google Ads


  • Avatars by Sterling Adventures
    Avatars by Sterling Adventures
    • Products
    • Reviews
    • Tutorials
    Copyright © 2012 ahmedgeek.com, Part of the GeeksAvenue.com Developers Network, All Rights Reserved