Archived topic
Elements - Header - 2 (or more) elements not possible?!
5 replies · Started by Sebastian on September 18, 2020
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!
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 :)
The solution with the hook element worked for me. However, is it also possible to limit a hook width-wise?
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 :)
Solved, you're awesome!
Glad to hear :)