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.

Recent Posts

Sam Bauers on bbPress [video]

As mentioned in a previous post, I was able to record about 85% of the…

47 minutes ago

The actually release of WordPress 2.8 announced

The WordPress development blog has put a date on the release of 2.8, plus some…

13 hours ago

Ben Dunkle on designing icons for WordPress [video]

I know many people attendedWordCamp 2009, in fact I believe there were 700 plus attendees.…

2 days ago

Notes from WordCamp San Fransisco

Over view notes of San Francisco WordCamp 2009 by [insert creator]??

2 days ago

The state of the Press

I might like to start off by saying Happy Birthday WordPress. I don't have any…

3 days ago