[Resolved] Element – Header adjustments etc

Home Forums Support [Resolved] Element – Header adjustments etc

Home Forums Support Element – Header adjustments etc

Viewing 15 posts - 16 through 30 (of 43 total)
  • Author
    Posts
  • #1153474
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    1. So are you wanting the static featured image inside the content, and no background image in the Page Hero?

    2. Try changing your content to this:

    <h1>
    {{post_title}}
    </h1>
    <div class="hero-meta">{{post_author}}
    [avatar]</div>

    Then try reducing your page hero padding.

    3. For the link colors, are you sure the link color is set in your Page Hero settings?

    #1154512
    Jacob

    Hi Tom, thanks. Everything works pretty fine now. But I still did not manage to only get 1 imageinside the content. Even after changing the conten as you suggested.

    Actually, I would not mind keeping the standard, defaul settings with H1 in the top (inside container) and then image with the Author image and author title covering the image. (Maybe with the “parallax” function).

    Or I could have as before both header and author over the image but it would be nice with the image inside the content (and with only 1 image not 1 above and then 1 inside).

    Thanks.

    #1154711
    Tom
    Lead Developer
    Lead Developer

    Do you have any examples of the layout/look you’re aiming for? It might help me understand a bit better.

    Let me know 🙂

    #1154719
    Jacob

    Hi Tom! How about this page: https://webshopsguiden.se/dropshipping/
    But with a featured image with name of author in the left, lower corner (of the image)?

    Thanks

    #1155654
    Tom
    Lead Developer
    Lead Developer

    Ahh, so you want the page hero inside the content?

    If so, try this:

    add_filter( 'generate_page_hero_location', function() {
        return 'generate_before_content';
    } );
    #1156043
    Jacob

    Thanks Tom I was not sure if that code goes in the content area or in the CSS. But I assume it is a CSS code anyway, I tried both just to be sure and it does not work. Still have 2 images and the author + img stayes in the upper image.

    Is there anyway I could you access to fix the problem?

    #1156336
    David
    Staff
    Customer Support

    Hi there,

    that code is PHP – this article explains how to add it to your site:

    https://docs.generatepress.com/article/adding-php/

    TLDR: If you don’t have a Child Theme – use the Code Snippets plugin to add the code.

    #1156811
    Jacob

    Hi thanks, sorry I’m a bit lost here.. So I am using GP Premium, I don’t know if that is a “Child theme”?

    Thanks amd sorry:)

    /Jacob

    #1156848
    Jacob

    Thanks, I installed the plugin and entered the code it worked! Cool!

    1. So, what if I would like to keep the default header (above the feaured image). How could I disable the H1 from the page Header/Hero and only keep the deafault theme header? (If this is troublesom I can keep it the way it is now but would be an interesting option).
    2. I see that the text starts very close to the image (unlike the default pages I have else where on the site) How could I create some space between the featured image and the the first paragraph? (So it looks as the pther pages without the page header)?
    3. The [Avatar] comes with a link for the author name. Same it seems for your {{post_author}}. Can I enter some code to idsable that link and just present the name in plain text?

    Thanks very much for your support! Sorry about my rookie-questions:)

    /Jacob

    #1157203
    Tom
    Lead Developer
    Lead Developer

    1. Not too sure what you mean here – if you want the H1 removed from the Header Element, you should just be able to remove it from the hero content.

    2. Try this CSS:

    .page-hero {
        margin-bottom: 40px;
    }

    3. This depends on where [avatar] is coming from. As for {{post_author}}, try this PHP:

    add_filter( 'generate_page_hero_post_author', function() {
        global $post;
        $author_id = $post->post_author;
    
        return sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author"><span class="author-name" itemprop="name">%1$s</span></span>',
            esc_html( get_the_author_meta( 'display_name', $author_id ) )
        );
    } );
    #1157755
    Jacob

    Thanks Tom. Amazing!

    1. When I remove the H1 from the content in the Element the H1 disappears= no Page title on the page at all. What I am asking is to keep the H1 as it is without any Header Element but to be able to add/keep the author image, name and parallax (covering the featured image). So the header is actually not in the Header element, but the other things are in the element.. But maybe this is done with just another page hero hook.. (?) (Not the “Header element”)
    2. Great! Works! Thanks!
    3. Great! Works! Thanks!

    Thanks for everything!

    /Jacob

    #1158413
    Tom
    Lead Developer
    Lead Developer

    Are you disabling the content title another way? Maybe using Disable Elements?: https://docs.generatepress.com/article/disable-elements-overview/

    #1159676
    Jacob

    Hi Tom, thanks. No I am not disable the lements in any other way. (I doubble checked).

    #1159804
    Tom
    Lead Developer
    Lead Developer

    Can you remove the title from the page hero so I can see?

    If the title isn’t displaying it means:

    a) The Disable Elements metabox has it disabled
    b) You have a Layout Element applied which is disabling it
    c) You have a custom function which is disabling it

    #1159998
    Jacob

    Hi Tom! You are completely right. (You must have a lot of patience. Thanks). I am an idiot. Now when I take the h1 out the header appears as it should. Maybe I missed it since it appears under the image, instead of above (as the default theme).

    1. If I want the header to appear above the image, how could I do that?

    2. Another thing since I already have this topic open:

    How could I place the name of the author below the author-image, instead of on the right hand side of the image?

    I am using this content in the element:

    [avatar]
    {{post_author}}

    Thanks and sorry!

Viewing 15 posts - 16 through 30 (of 43 total)
  • You must be logged in to reply to this topic.