[Resolved] Elements – Header – 2 (or more) elements not possible?!

Home Forums Support [Resolved] Elements – Header – 2 (or more) elements not possible?!

Home Forums Support Elements – Header – 2 (or more) elements not possible?!

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1449150
    Sebastian

    Hi there,

    first of all, I really appreciate your support in this forum, it’s super helfpul!

    I’d have the following question:
    I’ve created two elements, both for the header section, both to be shown below the primary navigation. For whatever reason, only one of these two elements is shown.

    The only difference between both elements (apart from the contents: #1 is simple text with a colored background, #2 is a slider plugin) is that #1 is shown on all pages, #2 is only shown on frontpage. So ideally both are shown on frontpage (order: primary navigation – #1 – #2), and on all other pages it’s simply: primary navigation – #1.

    Thanks in advance for your help!

    #1449164
    Leo
    Staff
    Customer Support

    Hi there,

    Are you referring to the header element here?

    If so you can only add one of them at the time.

    Couple of solutions for this:

    – Combine the content of 2 header element into 1.

    – Add the slider using a hook element instead and set it to after_header for hooks and front page in display rules:
    https://docs.generatepress.com/article/hooks-element-overview/

    Let me know if this works for you πŸ™‚

    #1449192
    Sebastian

    The solution with the hook element worked for me. However, is it also possible to limit a hook width-wise?

    #1449223
    Leo
    Staff
    Customer Support

    Is the hook element just a shortcode?

    If so try this for the HTML structure:

    <div class="hook-slider">
        [slider shortcode]
    </div>

    Then this CSS:

    .hook-slider {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Let me know if this helps πŸ™‚

    #1450175
    Sebastian

    Solved, you’re awesome!

    #1450195
    Leo
    Staff
    Customer Support

    Glad to hear πŸ™‚

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