How to add facebook Share button WordPress

Add with a simple HTML line the Share button from facebook


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.


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

<a name="fb_share"></a> <script src="//" type="text/javascript"></script>
Code language: HTML, XML (xml)

That's it!

You can customize the text just like this:

<a name="fb_share">Sharing from WordPress</a> <script src="//" type="text/javascript"></script>
Code language: HTML, XML (xml)

More Info

Check out the Oficial facebook documentation.

  • 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)


    • 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:

      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.


      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 🙂

    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.

    yes, the LinksAlpha plugin is here:

    I tried disconnecting the share facebook button. No success.

    as always, thanks!

  • Quicoto

    where can I find the single.php file?

    • 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:)

Leave a Reply

Add <code> Some Code </code> if you need to.