Make WordPress Twitter Embeds Responsive

By default WordPress twitter embedded tweets have a fixed width of 550px which is added to the inline style with an !important declaration to stop you overriding it. This breaks responsive layouts and causes horizontal scrolling as soon as your site is viewed at less than 550px wide.

Add the following to your themes functions.php file:

add_filter('oembed_result','twitter_no_width',10,3);
function twitter_no_width($html, $url, $args) {
	if (false !== strpos($url, 'twitter.com')) {
		$html = str_replace('width="550"','',$html);
	}
	return $html;
}

This removes the hardcoded 550px width from the generated output. If you’ve got existing embedded tweets you’ll need to re-save the posts to regenerate the embed code.

Thanks to Otto for the tip.

Brighton’s Big Screen!

Brighton open air big cinema screen For the next 3 weeks there’s a big screen on Brighton seafront shows the Olympics in the day and films in the evening.

An exciting new event is on the horizon for Brighton over the course of the hugely anticipated games programme.Brighton’s Big Screen will be bringing a 100 square ft LED screen to Brighton’s Seafront from 27th July – 12th August 2012 to broadcast coverage of the Games plus a selection of blockbuster movies including Avatar, Finding Nemo and Grease.

– Brighton’s Big Screen

I went to see Jaws tonight, a perfect film for the setting! Check out the schedule, highlights include the relatively recent Hunger Games on Wednesday 3rd of August and Avatar on the 7th.