[Support request] Have Featured Image/Title Width set to post width

Home Forums Support [Support request] Have Featured Image/Title Width set to post width

Home Forums Support Have Featured Image/Title Width set to post width

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1541487
    Caitlin

    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,
    Caitlin

    #1541516
    Elvin
    Staff
    Customer Support

    Hi,

    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. πŸ™‚

    A wise man once said:
    "Have you cleared your cache?"

    #1541526
    Caitlin

    It’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,
    Caitlin

    #1541534
    Elvin
    Staff
    Customer Support

    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?

    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/eDuwklKQ

    It should display the featured image inside the content area which is aligned with the sidebar.

    A wise man once said:
    "Have you cleared your cache?"

    #1541552
    Caitlin

    I have that set but it’s still putting the feature image/title across the entire page. (I did clear the cache)

    #1541569
    Elvin
    Staff
    Customer Support

    Can 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. πŸ™‚

    A wise man once said:
    "Have you cleared your cache?"

    #1541582
    Caitlin

    I sent you the site link info in the private information box.

    #1541588
    Elvin
    Staff
    Customer Support

    Thanks. πŸ˜€

    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-element

    A wise man once said:
    "Have you cleared your cache?"

    #1541592
    Caitlin

    If 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.

    #1541935
    David
    Staff
    Customer Support

    Hi 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;
    } );
    #1542636
    Caitlin

    Where do I add that snippet? In the header element for single posts?

    #1542711
    Leo
    Staff
    Customer Support

    You 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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.