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?