- This topic has 11 replies, 4 voices, and was last updated 3 years, 4 months ago by Leo.
-
AuthorPosts
-
November 22, 2020 at 2:11 pm #1541487Caitlin
The default for the featured image posts on single pages is to span the entire page with the sidebar pushed down to be aligned with the start of the article content. I want to have the featured post image (the one that the title overlays) to only be as wide as the post. I want the sidebar to be aligned with the start of the feature image/title. Is there a way to do this?
Thanks,
CaitlinNovember 22, 2020 at 2:54 pm #1541516ElvinStaffCustomer SupportHi,
Can you link us to the site you’re working on?
I believe you’re using a Header Element or your posts.
Disabling this for your posts will change the format back to the default where the featured image is inside the content, which is aligned w/ the sidebar rather than having its own full width section. π
November 22, 2020 at 3:19 pm #1541526CaitlinIt’s https://www.librarycat.com/the-tradition-of-library-cats/.
I disabled the element but that removes the overlay of the title on top of the feature image. Is there a way to preserve the styling of that element but have it centered only over the post?
Thanks,
CaitlinNovember 22, 2020 at 3:31 pm #1541534ElvinStaffCustomer SupportI disabled the element but that removes the overlay of the title on top of the feature image. Is there a way to preserve the styling of that element but have it centered only over the post?
You can restore the element and do this instead.
Go to WP Admin Dashboard > Appearance > Customize > Layout > Blog and under Featured Image, click “posts” tab and make sure “Display featured image” is checked.
https://share.getcloudapp.com/eDuwklKQIt should display the featured image inside the content area which is aligned with the sidebar.
November 22, 2020 at 3:48 pm #1541552CaitlinI have that set but it’s still putting the feature image/title across the entire page. (I did clear the cache)
November 22, 2020 at 4:15 pm #1541569ElvinStaffCustomer SupportCan you link us to the site you can working on so we could check?
You can add the site credentials/details on the Private Information text field. Thank you. π
November 22, 2020 at 4:34 pm #1541582CaitlinI sent you the site link info in the private information box.
November 22, 2020 at 4:43 pm #1541588ElvinStaffCustomer SupportThanks. π
You can try opening your Header Element and set Background Image to “No Background Image” to remove the featured image on it.
We then check for any Layout Element that disables the Featured image.
On the Disable Element tab, make sure “Featured Element” is unchecked.
https://docs.generatepress.com/article/layout-element-overview/#disable-elementNovember 22, 2020 at 4:49 pm #1541592CaitlinIf I remove the featured image then the header is now a gray gradient with the title. I want the featured image, I am just looking to keep the style of having the title/meta overlay on top of the featured image.
Also, when I look at the tabs for the element, I don’t have a “disable elements” tab.
November 23, 2020 at 1:54 am #1541935DavidStaffCustomer SupportHi there,
so as i read it, you want to keep the Header Element but to display above the main content.
If thats the case then try adding this PHP Snippet:add_filter( 'generate_page_hero_location', function( $location ) { if ( is_single() ) { $location = 'generate_before_content'; } return $location; } );
November 23, 2020 at 8:19 am #1542636CaitlinWhere do I add that snippet? In the header element for single posts?
November 23, 2020 at 9:26 am #1542711LeoStaffCustomer SupportYou would need one of these methods
Adding PHP: https://docs.generatepress.com/article/adding-php/Code Snippets is the easiest if you aren’t using a child theme already.
-
AuthorPosts
- You must be logged in to reply to this topic.