I want my post's featured image show as a full width hero image. I have tried to set the featured images as background images in a full-width row, but I think it is not possible.
If anyone have the answer or a way to set the featured image as a hero, then please suggest.
I want my post's featured image show as a full width hero image. I have tried to set the featured images as background images in a full-width row, but I think it is not possible.
If anyone have the answer or a way to set the featured image as a hero, then please suggest.
Share Improve this question asked Feb 21, 2020 at 13:27 Suman MSuman M 31 bronze badge 1- Please edit your question to specify what you've tried and what specific problems you're having. Relevant code samples will make it much easier to assist you. – Pat J Commented Feb 21, 2020 at 17:32
1 Answer
Reset to default 0You need to look at how your theme is rendering the hero image. Then, before it does so, add an if block which checks for a featured image. If a featured image exists, replace the hero image with it. Your code will look something like this.
if ( has_post_thumbnail() ) {
// render hero image using the_post_thumbnail() instead
}