- This topic has 19 replies, 4 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 21, 2022 at 12:39 am #2424889
Frank
I’m currently trying to design the header at http://www.lanordischvita.de. I’ve tried using an elements hook with no success. Now I have integrated the social icons as a widget in the header with GenerateBlock (container/button). The desktop view works. How do I get the icons to the right of the logo in the mobile view? No matter what I set, the icons are always above the logo. I don’t know much about CSS. Can you help me?
November 21, 2022 at 1:15 am #2424932Fernando Customer Support
Hi Frank,
Yes, we can help you.
Can you try adding this in Appearance > Customize > Additional CSS?:
@media (max-width: 768px) { header.site-header > .inside-header { display: flex; flex-direction: row-reverse; } }This should place the Social icons you have to the right of the logo on mobile.
November 21, 2022 at 2:00 am #2424993Frank
Hello Fernando,
that looks a lot better, thanks. When I hold the phone sideways, the logo shifts to the right, but it should stay on the left. Did I do something wrong? And could the icons also be centered horizontally?November 21, 2022 at 4:28 am #2425163David
StaffCustomer SupportHi there,
can i suggest a different method?
If yes, then:1. remove any CSS you have so far.
2. In Customizer > Layout > Primary Navigation set the Alignment Right and then the Location to:
Float Right3. remove the header widget social buttons, before doing so – copy the Buttons blocks as you can reuse it.
4. In Appearance > Elements -> Add New Block Element
4.1 Add (Paste in ) your social icon buttons
4.2 Set the Hook to:menu_bar_items
4.3 Set the Display Rules toEntire Site
4.4 Publish5. Add this CSS to your site:
@media(min-width: 769px) { .inside-navigation .menu-bar-items{ order: -1; flex: 1 0 100%; justify-content: flex-end; } }November 21, 2022 at 5:05 am #2425227Frank
Hi David,
I fail at point 4. I choose “Block” for Elements and add the icons. I can’t select 4.2 and 4.3. I don’t find an entry “menu-bar-item” and then also no “Enture Site”.November 21, 2022 at 5:37 am #2425289David
StaffCustomer Support4.2 Whilst in the block element editor, the right hand sidebar there are two tabs, one to them is Titled: Element. Selec that and you should see the screenshot provided here:
https://docs.generatepress.com/article/block-element-hook/
4.3 Do you see the Display Rules panel ?
November 21, 2022 at 5:51 am #2425310Frank
Under Hook there was no entry with “menu_bar_items”. So I made a custom hook with this entry. I set the display rules to “Entire page”. I added the CSS in the Cutsomizer under additional CSS. Cache is emptied. But the social icons are not displayed. Instead, the menu is now in the top right corner of the desktop view, which is not great. What can I do?
November 21, 2022 at 7:17 am #2425412David
StaffCustomer SupportOK, if that hook is not showing the go to Customizer > General and change the Structure to Flexbox.
Then edit your Element and you should see that hook ?November 21, 2022 at 7:43 am #2425443Frank
Now I can select “menu_bar_item” and the mobile view is perfect, great. Can I get the menu in the desktop view at the bottom of the header? It’s in the middle now.
November 21, 2022 at 10:54 am #2425993Ying
StaffCustomer SupportTry this CSS for desktop:
@media (min-width: 769px) { #primary-menu { order: -1; } }November 21, 2022 at 11:10 am #2426030Frank
Hello Ying,
thanks for trying, unfortunately without success. Both CSS together result in an exchange of menu and icons (menu even higher and icons below). Your CSS alone puts the icons in the menu line, but the menu remains at the top. Unfortunately I can’t get the menu to the bottom edge of the header.November 21, 2022 at 12:12 pm #2426118Ying
StaffCustomer SupportBoth CSS together result in an exchange of menu and icons (menu even higher and icons below)
That was my intention, thought it was what you were looking for.
I don’t think I understand your request very well, any chance you can make a mockup?
November 21, 2022 at 10:31 pm #2426630Frank
Anyway, thanks for trying. 🙂 Everything looks perfect in the mobile view. My idea only affects the desktop view. Is it possible to put the primary menu horizontally at the bottom of the header? So put down? It’s still in the middle now.
November 22, 2022 at 12:45 am #2426699Fernando Customer Support
I see. If you want the primary menu at the bottom of the Header, you can go to Appearance > Customize > Layout > Primary Navigation, and then set the Navigation Location to “Below Header”.
Then, we can fix the Mobile Header afterward.
If you’re referring to something else, can you provide a sketch or a reference site with a similar Header?
Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
November 22, 2022 at 2:35 am #2426843Frank
Hello Fernando,
then we would be back where we started at the beginning. 🙂 If I put the primary menu under the header, the header becomes very tall again. Everything looks great now. It would only be nice if the primary menu was at the bottom in the desktop view, but not under the logo. If there is no easy solution, no problem. But if you have an idea, you’re welcome. -
AuthorPosts
- You must be logged in to reply to this topic.