Hey Chris,
set the display option in the admin panel to “manual” and the shortcode should only be visible one time per shortcode.
Hi Rene,
Thanks for responding but you misunderstood my question. The buttons are not displaying in the proper order with the rest of the article. In the post sample above, please note that the shortcode [my-share] is used twice so that the buttons appear at the beginning and end of the article. However, both sets of buttons appear at the beginning of the article. For some reason, the buttons are out of sequence with the article and always appear before the article. Do you have any suggestions on how to serialize the buttons with the output of the article?
Best,
Christopher
Hi,
your code looks ok so far.
Can you try in file mashsharer.php
Replace:
function mashsharer(){
global $content;
global $atts;
$mashsharer = new mashsharer();
echo $mashsharer->mashsharerShow($atts);
//$mashsharer->mashsharer_filter_content($content);
}
with:
function mashsharer(){
global $content;
global $atts;
$mashsharer = new mashsharer();
return $mashsharer->mashsharerShow($atts);
}
If this work, i will change my shortcode function.
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Rene,
Thanks, your proposed change (replace echo with return) worked. I also made a slight change to my code as well, which is now:
function my_share()
{
return mashsharer();
}
add_shortcode('my-share', 'my_share');
Now, it will be much easier to convert all the buttons on my site from one plugin to another in one simple step. Thanks again.
Best,
Christopher