this might not be for toolset but i am having issue with toolset related pages only.
i have big issue getting the social share plugin to work with toolset,
so i am testing 2 plugins., both have shortcodes : [social_warfare] , [easy_social_share] ,
this is my simple snippet ,
function my_social_share(){
$string_with_shortcodes = "<div class='rss'>[social_warfare]</div>";
echo do_shortcode($string_with_shortcodes);
// [easy-social-share] or [social_warfare]
}
add_shortcode('my_social_share', 'my_social_share');
i hope to manage the shortcode manually by editing the fn instead of editing every single layout template.
so my shortcode is [my_social_share]
it does load . but the problem is the it load at the most top position of the website,.
if i were to add the individual shortcode in the layout container directly, it load fine, same with other wp pages and post.
Do you see any issue with fn above ?
i have registered the shortcode at the toolset setting page.
With shortcodes you return the string to be output. You are echo-ing it, which means it gets printed to the screen when the code is encountered and not in the correct stage of building the page.
Well, registering a custom shortcode just to output another shortcode wrapped in a div seems a bit like overkill, but if you are inserting the original shortcode in a lot of places and want to save yourself the trouble of having to write that wrapper div manually each time, then I guess I see why.
As to whether you are doing it right, well, it looks okay, but the proof is in the pudding. Does it work?