Shortcodes displaying on posts but not pages

Posted in: Newspaper
Post count: 13

I created a custom shortcode which displays an embedded facebook like button for certain pages. When I add this shortcode to a widget menu displayed on an individual post page it works. However, when I add this shortcode to a custom page, like the home page, it does not show. I’ve tried embedding via text, widget menu, embedded html/js and none of those fix the issue. I know the code is correct as it renders on posts, just not others.

here is the code for the shortcode:

<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div id="facebook_like_container_small">
<span class="like_us">Like This Site</span>
<div class="fb-like"
data-href="http://www.facebook.com/oursite"
data-send="false"
data-layout="button_count"
data-width="100"
data-show-faces="false"
data-colorscheme="light"
data-font="verdana">
</div>
</div>
<!-- END facebook_follow -->

Post count: 5

I’d like to know too

Post count: 23312

Hello tootiefrutie,

Unfortunately, the above code is not from our theme, it is created by you and we cannot offer support to your custom work, sorry! Probably it is correct or not. Please notice that we cannot afford to check this code and test them with the theme because this task involves time-consuming and the time is too short to do that, sorry! Please keep in mind that our Visual Composer shortcodes which are generated for blocks/modules and any other elements work fine for posts and pages. I cannot provide you an accurate response regarding on your custom work because we cannot do that and we are unavailable to do that at the moment, sorry!

Thank you for your understanding!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.