PHP Freelancer

  • Home
  • About
  • Contact Me
  • SiteMap
  • WordPress Plugins
    • WP Ajax Social – WordPress Social Plugin
  • Home
  • About
  • Contact Me
  • SiteMap
  • WordPress Plugins
    • WP Ajax Social – WordPress Social Plugin

WordPress Use Social Sharing Toolkit Plugin Outside Loop

Ankur • August 16, 2013 • Leave a comment

Social Sharing Toolkit is very nice social plugin, it works smoothly. In this article I will show you how you can use Social Sharing Toolkit Plugin Outside Loop. Sometimes we need to show social icons outside wordpress loop and outside loop things doesn’t work properly, So thats why I thought to share it here.

If you got a condition where you want to show social icons but you want to show it outside loop then you can use it as shown below :

<?php
    $social_sharing_toolkit = new MR_Social_Sharing_Toolkit();
    echo $social_sharing_toolkit->create_bookmarks();
?>

Also if above solution not working for you it means your global variable for post data not set and thats why it is not getting post data and hence not working. So in that case you can use below code snippet in which you can pass post link and post title.

<?php
    $social_sharing_toolkit = new MR_Social_Sharing_Toolkit();
    echo $social_sharing_toolkit->create_bookmarks('{your-link}', '{your-title}');
?>

So in above snippet you need to replace ‘{your-link}’ with your post link variable and ‘{your-title}’ variable with post title variable. So this is way by which you can use social sharing toolkit plugin outside loop.

If you are facing any issue to use this plugin then write down in comments I will try to help you.

Tagged: social sharing toolkit outside loop

Post navigation

««How To Work With jQuery Multiple Elements With Same Id
Solution of Fatal error: Call to undefined function w3tc_button_link()»»

Ads

Contact me

Hi, you can contact me through the form below.
Add on Microsoft Teams: anku.gandhi@outlook.com
Email: anku.gandhi@gmail.com

Join Us On Facebook!

My Circle

  • Freelance Web Design
  • PHP Freelancer India
  • PHP Wordpress Developer
  • Wordpress Freelancer India
Powered by WordPress. Theme by moyu