Twitter feed isn't loading any content


#1

Hey,

I am trying to add a twitter feed to a site i’m working on but it just loads a blank iFrame, very occasionally the twitter feed will randomly load but after refreshing it doesn’t display again. I have added the feed to a blank php file and it loads fine so there must be some kind of conflict happening, could anyone please help?

Here’s the code for the feed I am using -

<a class="twitter-timeline" href="https://twitter.com/grapegrainfest" data-widget-id="491918809356181504">Tweets by @grapegrainfest</a>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>

Here is the URL for the page - http://grapegrainfestival.co.uk/dev-home/
If you press the buy tickets button it will scroll down to the right area, the feed should be in the ‘News’ box to the right of the tickets section.

Thanks, Harry.


#2

Had the same problem. Here’s what worked for me:

  1. Load the widgets.js like this ( to be able to reference it later):


    2. Add this bit after inserting the twitter anchor:

    twttr.widgets.load();

    3. You can even listen to the widget load, so you can do stuff when it’s done loading by using:

    twttr.events.bind(‘loaded’, function (event) {
    // this code will be executed when the widget is loaded
    });

#3

#4