Modify WordPress img src for the “get_the_post_thumbnail”

Expose the WordPress “img src” part from the get_the_post_thumbnail, to modify the “img src” syntax.

Add the following code to your functions.php file of the theme you wish to use the custom image sizes for.

*note, for adding complimentary markup, classes and ID’s, you can do so by using regular expressions such as class="img-responsive"


Leave a Reply

Your email address will not be published. Required fields are marked *