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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Try 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