Skip to content

Instantly share code, notes, and snippets.

@raideus
Created April 29, 2012 17:35
Show Gist options
  • Save raideus/2552156 to your computer and use it in GitHub Desktop.
Save raideus/2552156 to your computer and use it in GitHub Desktop.
jQuery script for implementing fluid images on a WordPress site
jQuery(document).ready(function($) {
// Remove width & height attributes from images (added by default in WordPress)
$('img').removeAttr('width').removeAttr('height');
// Remove style attribute on image captions, which sets a fixed width by default
$('.wp-caption').removeAttr('style');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment