Categories: Tips & Tricks

How to: Create a fbshare.me shortcode

Don’t know PHP that well?

Well here is a simple way to add a share script like fbshare.me to your site, via shortcodes.

Paste the following code in your functions.php file in order to create your shortcode:

function fbshare_script() {
     return '<div class="fbshare"><script src="http://widgets.fbshare.me/files/fbshare.js"></script></div>';
}
add_shortcode( 'fbshare', 'fbshare_script' );

Once done, you can display the facebook share button anywhere on your posts. In WordPress editor, make sure you are in HTML mode and insert the following: [fbshare].

When your post will be published, the shortcode will be replaced by the fbshare.me button.

Web Master

Hi, I am Miguel, I bought this site in 2009. So I now run or manage the site. Please visit my new website or follow me on twitter @W3i.

View Comments

  • I didn't even know you could do this. I'd seen a script to do something similar but it was written in some complicated CURL/PHP code. So thanks for this!

Recent Posts

8 Content Ideas To Boost Your Real Estate Blog

When you have a real estate blog, sometimes it can be difficult to come up…

40 minutes ago

A Tweeter Guide to Branding Marketing Stars-Luminaries You Should Follow

When it comes to your business, marketing is extremely important. With the popularity of social…

13 hours ago

Lost? Since You Can’t Trust Apple Maps, Check Out These 3 Apps Instead

Maybe you have the new software on your Apple device that has made headlines as…

1 day ago

An Overview Of Business Models

Knowing Where To Start There are a number of conceptual business models that are used…

2 days ago

Google’s New Tool For Bad Links

Google recently announced it has launched its Disavow Tool which allows webmasters to alert Google…

2 days ago

5 Reasons Why You Should Or Should Not Use WordPress Plugins

Depending on your needs, WordPress plugins are the best and worst aspects of WordPress. The…

3 days ago