I have to add img-responsive class to an image in wordpress page template.
My file is named as single-product.php.
This is my code
<div class="col-md-6 col-xs-12" style="margin-top:35px;">
<h1><?php the_title();?></h1>
</div>
<div class="col-md-6 col-xs-12">
<?php the_post_thumbnail();?>
</div>
Now my question is how to add class to thumbnail?
Please assist me.
You can pass the class name in the_thumbnail function .
For More Refrence
https://codex.wordpress.org/Function_Reference/the_post_thumbnail
the_post_thumbnail() takes two arguments, size and an array of attributes. one of the attributes you can set in the array is class, so an example would look like this
you may want to change thumbnail to the size you would like, or perhaps you can leave it blank. as always search the codex for the function in question and it normally has the answers https://codex.wordpress.org/Function_Reference/the_post_thumbnail
Like this,
Also, it is not a good practice to use inline styles in your code.