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

Jon Asked: How to add thumbnails above post on the THiCK theme

I was asked by a reader: I'm using the THiCK theme for my new design…

7 hours ago

13 Best WordPress Email Marketing Plugins

The article lists the 13 best WordPress email marketing plugins for 2022 - HubSpot, ConvertKit,…

5 hours ago

AI Chips in 2024: Navigating NVIDIA’s Dominance and Emerging Competitors

In 2024, NVIDIA remains a dominant force in the AI chip market with its innovative…

17 hours ago

21 Best ChatGPT Prompts for Marketing and How to Utilize Them Effectively

In the rapidly evolving realm of digital marketing, ChatGPT has emerged as an invaluable tool,…

1 day ago

WP Cult attending WordCamp Denver 2009

It is official, today I purchased my ticket for WordCamp Denver! I as well as…

2 days ago

Navigating the AI Revolution: 7 Key Challenges for Web Professionals

AI's Transformative Impact on Web Professionals Artificial intelligence (AI) is revolutionizing the digital landscape, and…

2 days ago