$(function() { $(".lady-josephine-block--tweet").each(function(i, element) { tweetUrl = $("*[tweet_url]",element).attr("tweet_url") var oembedUrl = 'https://api.twitter.com/1/statuses/oembed.json'; var params = { hide_thread: 1, maxwidth: 550, align: 'center', url: tweetUrl, iframe: true }; $.getJSON({ url: oembedUrl, data: params, success: function(data) { $(element).html( data.html ); }, dataType: "jsonp" }); }); });