PHP Shortcode
-
Hello,
I’ve recently installed the BestWebSoft Google +1 and Facebook Like plugins. I wanted to insert them in specific locations on my various sites and came across this post where a nice solution is offered for the Google +1 button. Essentially, the shortcode could be inserted into a PHP/HTML template file and the all of the boxes in the “Show Button” area could be unchecked so that only one instance of the button would appear. Is there a similar solution for the Facebook Like button plugin?
The shortcode certainly works fine:
<?php echo do_shortcode('[fb_button]'); ?>
However, I’m not able to hide the first instance of the button since the FB plugin doesn’t seem to offer the same “Show Button” options (i.e., there’s nothing to uncheck). As a temporary measure, I’ve hidden one of the buttons with CSS:
.fcbk_share:first-of-type { display: none; }
However, this isn’t ideal since the button will still need to load twice. It would be much better if I could simply turn off the display options for the FB button (as was done for the G+1 button) so that the PHP insertion would be the only instance displayed.
Any suggestions you have would be greatly appreciated.
Thank you,
JPhttps://www.ads-software.com/plugins/facebook-button-plugin/
- The topic ‘PHP Shortcode’ is closed to new replies.