Archived topic
Using Elements to show a featured image on a different place
5 replies · Started by Julien on September 19, 2020
Hello guys,
My goal is to set up a blog content with a sidebar on the right with widgets (for desktop).
But I want the sidebar not to show before the post title (by default it shows along with the featured image).
So I decided to use Elements with the hook "generate after header" and the PHO code "<?php the_post_thumbnail(); ?>"
It does work but I have several questions and problem :
- Do you think it's the best way to do ?
- With current configuration, the featured image is not centered (like not restricted to container) and the size is too big (I would like to have "medium" image size)
- With current configuration the blog background (white) is not displaying behind the featured image, which is ugly, how can I do to fix it ?
Thanks for help !
Hi there,
instead go to Customizer > Layout > Blog ---> Featured Images >> Posts - and set the location to Above Content.
https://docs.generatepress.com/article/adjusting-the-featured-images/
Ahah ! Sometimes it's a bad things to look for complicated solution ! Thank you David !
Meanwhile if I do that, the image is off container and doesn't have the normal white background like other elements. How should i correct that ?
:)
You would either need to add a larger image size to fill the space.
Or you can force them to fill the space with this CSS:
.single-post .featured-image img {
width: 100%;
}
Thanks David
You're welcome