0
votes

I am fetching the featured image of a post by the function

the_post_thumbnail('medium');

It was fetching the correct image before but I had changed the size of medium from 300 to 400 in wordpress media settings and regenerated all the images. The image with size 400 is present and got generated. But now it continues to fetch the 300 resolution image instead of 400.

How can I fix this and make it fetch the 400 size image?

1

1 Answers

0
votes

use this line of code add function.php

add_image_size( 'homeFeatured',300, 300, array('center','center') );

using this get the file in a specific size of the file.

<?php  the_post_thumbnail('homeFeatured') ?>