I just want to add new class for the featured img
CLASS: img-responsive
<img class="attachment-post-thumbnail wp-post-image" width="740" height="591" alt="bag_bg2-1024x818" src="sample/path">
to
<img class="attachment-post-thumbnail wp-post-image img-responsive" width="740" height="591" alt="bag_bg2-1024x818" src="sample/path">
Assuming you’re using the_post_thumbnail() or get_the_post_thumbnail() to retrieve the image tag, you can set classes in the $attr parameter passed to the functions. See http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail.
This also applies to generic attachment images:
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image
Foxaii
3
Nothing wrong with Donna’s suggestion but you can also use the Bootstrap mixins;
.wp-post-image {
.img-responsive();
}
2 Likes
cfx
4
+1 for using @Foxaii’s suggestion via LESS mixin!