- This topic has 11 replies, 3 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
November 16, 2020 at 9:15 am #1533685
ghazii
Hi,
I use Gerneratepress Premium and get stuck with the design of the mobile navigation.
I would like to move the hamburger menu all the way to the left and add some icons for mail, phone, route and Facebook on the right. I’ve already tried it with the element, but I want the elements to be evenly aligned.
In the attached picture you can see the current status on the left and the target status on the right.

Could you help me with specific code suggestions?
Many thanks in advance
MichaelNovember 16, 2020 at 11:08 am #1533784Leo
StaffCustomer SupportHi there,
Any chance you can link us to the site in question?
You can use the private information field.
Let me know 🙂
November 16, 2020 at 11:23 am #1533797ghazii
Hi Leo,
yes, it´s a Testing-Site for our Company….here is the Link:
November 16, 2020 at 4:43 pm #1533987Elvin
StaffCustomer SupportHi,
You can use the
generate_after_primary_menuto place your icons after the primary menu.Try this PHP snippet.
add_action('generate_after_primary_menu',function(){ echo 'your icons HTML code here'; });Just make sure to add
hide-on-desktopclass to it so it doesn’t appear on desktop.We then add CSS for the menu toggle so it doesn’t flex-grow throughout the whole nav bar:
@media (max-width:768px){ button.menu-toggle { flex-grow: unset; } }November 17, 2020 at 7:08 am #1534817ghazii
Hi Elvin,
thanks al lot for this help.
But where can i add the PHP-Snippet exactly? And how can i add the hide-on-desktop-class ?Sorry, but i´m not a crack in things like this 😀
November 17, 2020 at 11:43 am #1535166Leo
StaffCustomer SupportInstead of using the PHP snippet, I would recommend using our built-in hook element module instead:
https://docs.generatepress.com/article/hooks-element-overview/You should see the
generate_after_primary_menuunder the hook dropdown list.Then your content should be something like this:
<div class="custom-icons hide-on-mobile"> ICONS HTML HERE </div>November 17, 2020 at 12:02 pm #1535201ghazii
i´m sitting here since two hours and try to play with the hooks.
A Hook with the namegenerate_after_primary_menudoesn´t exist!i have also tried the others like
generate_after_mobile_menu_buttonand so on…with the same result.November 17, 2020 at 12:17 pm #1535237Leo
StaffCustomer SupportSorry try this instead:
https://www.screencast.com/t/3rO1z7cjUWe will get the hook added to the list 🙂
November 17, 2020 at 12:36 pm #1535263ghazii
when I do it as you describe it, something is actually displayed behind the navigation, but only on the desktop and not on mobile.
When I add “hide-on-desktop” to the class it doesn’t show up on either desktop or mobile: /
November 17, 2020 at 1:04 pm #1535287Leo
StaffCustomer SupportSorry. If you want to show it on mobile only then you should only use the
hide-on-desktopclass.I’ve edited the code above.
Also just to confirm, you are trying to add the icons here?
https://www.screencast.com/t/By3SEMELTHNovember 18, 2020 at 1:11 am #1535699ghazii
no Problem, Leo.
I wanted to add the Icons like you can see it in my Picture in the first Post. The right Version.
Hamburger on the left, Icons on the right.November 18, 2020 at 10:23 am #1536548Leo
StaffCustomer SupportSorry – in that case, try the
generate_menu_bar_itemshook:
https://docs.generatepress.com/article/generate_menu_bar_items/It should make things very easy especially if you are using GenerateBlocks already.
Let me know 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.