the_post_thumbnail sizes not working properly - Wordpress Solution
[Solved] - the_post_thumbnail sizes not working properly - Wordpress Solution |
---|
Try following codes |
I am trying to use the_post_thumbnail to display some thumbnail images on one of our pages.
I have set
However when I upload the images, they are all getting weird sizes. Some show up as 291x160, some 280x140 and other weird sizes. Is there any way to have the_post_thumbnail size the images the exact same size regardless of their original size? Alternatively, Is there a way for WP to crop them to that size instead of trying to shrink fit? Solution - 1Make sure in your functions.php you have this - Then in your template do this - Then you can use this plugin to regenerate your thumbnails. http://wordpress.org/extend/plugins/regenerate-thumbnails/ Solution - 2which theme you are using. check your themes functions.php file to check whether default thumbnail size is added using following function for more details of this function check http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size or for more details of this function check http://codex.wordpress.org/Function_Reference/add_image_size Solution - 3Hi, take a look at this video: [[LINK href="http://www.youtube.com/watch?v=SNSoqzRA_IY"]]Crop[[/LINK]] You can use it to crop images to exact size you need. |
Date: 2022-10-21 05:13:41 |
Category: Wordpress |