How to add facebook Share button WordPress

Add with a simple HTML line the Share button from facebook

Plugin

If you don’t wanna mess arround with your theme files you can download one of the hundreds of Share Plugins.

But in fact you don’t need an extra plugin. Let’s get to the code.

Code

Edit your single.php file and add the following line where you want to show the button:

That’s it!

You can customize the text just like this:

More Info

Check out the Oficial facebook documentation.

8 comments
  • hey
    how are you?

    Quicoto, do you know how to install a few share buttons on a wordpress blog ( I am using thesis_18 skin). the share buttons in one line? just above the article content?

    I had a special plugin for doing this for me, called LinksAlpha, where you could choose which social networks to include, (they have over 30) but there is one nasty aspect of it- whenever you share something on fb- they include the info about their application, same on twitter.

    time to do it by myself with some help.

    the question is:
    how to include the sharing buttons so they show up in one line, and in the exact place on the page where I want to?

    btw, thanks for the free chapter of the magento book ( I like this platform very much- the error still unsolved)

    Nicole

    • Hi Nicole,

      A lot of questions in the same comment 😛

      1) Well there is a bunch of good share plugins. Think about what your readers use (most of the social links are useless). A cool one is:

      http://wordpress.org/extend/plugins/sexybookmarks/

      2) Again the thesis theme… Well.. in a normal theme you should put the code (depend on the plugin) in the single.php file you can find the the_content() function.

      Could you paste the plugin link here? I’m sure they have a function you can paste whereever you want in your theme.

      Let me know if this helps here or in the forum.

      Regards

      Ps: I’ll arrange a giveaway competition about the Magento eBooks next week. Stay tunned 😉

  • hey!

    that’s so cool. I am looking forward to the competition, I like them too much!
    BacklinksMarket is a sponsor of the major prize in a competition that is running now on SuccesSupermarket.com/blog 🙂

    I know the sexy bookmarks plugin, I am using it. What I am looking for is yes connected to the single.php file, and looks like on Kikolani blog for example. On top of the post.
    http://kikolani.com

    yes, the LinksAlpha plugin is here:
    http://help.linksalpha.com/

    I tried disconnecting the share facebook button. No success.

    as always, thanks!
    Nicole

  • Quicoto

    where can I find the single.php file?
    help

    • Damn thesis theme ^^

      Perhaps the theme does not use the single.php but an other.

      Try to look for the the_content function.

      It prints the post content. You should put the facebook / twitter button near it.

  • Hey

    I found a plugin that helps you use many share buttons, and without forcing the person to publish the name of the plugin or the company that created it. So I will stay with it for now and see how that works.

    thank you:)
    N.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*