admin管理员组文章数量:1303343
i made a blog and now i want to fix the issue if somebody doesn't add an image to use as the thumbnail, I want to use a default image. I did find a plugin that fixes that, but i would like to change the featured image on the single post page. So the thumbnail on the blog layout is the square logo and on the single post page is the full width logo i have. Not sure if this is possible to make the single post featured image different than the one on the main blog page.
The square logo shows perfectly in the blog layout, but in the single post page it doesn't look good. So i would like to set different default images or replace the image on the single post page using php, wich i didn't find working code for.
Anybody knows how i can fix this? Thanks
i made a blog and now i want to fix the issue if somebody doesn't add an image to use as the thumbnail, I want to use a default image. I did find a plugin that fixes that, but i would like to change the featured image on the single post page. So the thumbnail on the blog layout is the square logo and on the single post page is the full width logo i have. Not sure if this is possible to make the single post featured image different than the one on the main blog page.
The square logo shows perfectly in the blog layout, but in the single post page it doesn't look good. So i would like to set different default images or replace the image on the single post page using php, wich i didn't find working code for.
Anybody knows how i can fix this? Thanks
Share Improve this question asked Mar 4, 2021 at 11:13 Sander1020Sander1020 153 bronze badges1 Answer
Reset to default 0Try with uploading the bigger size image and then call it based on the requirement :
the_post_thumbnail( 'thumbnail' ); // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' ); // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' ); // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' ); // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' ); // Full resolution (original size uploaded)
I hope it helps.
本文标签: Blog replace single post page featured image
版权声明:本文标题:Blog replace single post page featured image 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741705181a2393517.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论