Skip to content

Instantly share code, notes, and snippets.

@CoachBirgit
Last active August 29, 2015 14:13
Show Gist options
  • Save CoachBirgit/89ca526db0d3b799d0fb to your computer and use it in GitHub Desktop.
Save CoachBirgit/89ca526db0d3b799d0fb to your computer and use it in GitHub Desktop.
WordPress: make post-thumbnails responsive by default
/* make post-thumbnails responsive by default */
add_filter('post_thumbnail_html','tm_add_class_to_thumbnail');
function tm_add_class_to_thumbnail($thumb) {
$thumb = str_replace('attachment-', 'img-responsive attachment-', $thumb);
return $thumb;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment