1

I have a twitter text widget in my Sidebar with html code for both Facebook and twitter follow buttons. The Facebook one works fine, but the twitter one does not render write.

The odd part here, is in the customize view of Wordpress, the twitter widget renders perfectly fine, as show in this picture:

enter image description here

But when I publish it and view my website at www.cattywampur.com it renders like this:

enter image description here

The code in my widget looks like this:

<div class="fb-follow" data-href="https://www.facebook.com/cattywampur/" data-layout="button_count" data-show-faces="true"></div>

<br>
</br>


<a class="twitter-follow-button"
  href="https://twitter.com/Cattywampur"
  data-size="large">
Follow @Cattywampur</a>

<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&version=v2.5&appId=143819872422578";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I am mostly confused with why it renders fine in the preview but when I publish it, it doesn't look the same?

1

When the page is published for some reason, you appear to be missing the widgets.js script on your page.

At least it does not appear on your homepage. When you save the text widget, it might be removing the script tags. If that's the case, you can edit your theme's footer and add the relevant Javascript code to transform the link.

  • That worked, I just put the widgte.js text in the sidebar widget! Thanks! – Mike Apr 1 '16 at 3:16
  • 1
    Sweet glad that worked. Good luck! – drew010 Apr 1 '16 at 3:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.