0

Is there a way to add css classes or ID's to images in wordpress? Or is there a media library plugin that adds a "css classes" field so you can add a class for that particular image once uploaded?

Cheers!

Vee
  • 1
  • 1

1 Answers1

1

Try this,

function add_image_class($class){
$class .= ' additional-class';
return $class;
}
add_filter('get_image_tag_class','add_image_class');

or

the_post_thumbnail('thumbnail', array('class' => 'img-responsive'));

Hope this will helps you.

For more information,

Sunil Dora
  • 1,407
  • 1
  • 13
  • 26