- This topic has 26 replies, 4 voices, and was last updated 3 years, 7 months ago by
Carsten.
-
AuthorPosts
-
April 2, 2020 at 1:37 pm #1224100
Carsten
Hi here, I would like to create something like this, with a sub nav of the three most used pages, like the ones marked with arrows here:
April 2, 2020 at 1:50 pm #1224110Leo
StaffCustomer SupportHi there,
That’s for mobile correct?
If so you can use the secondary navigation with this method:
https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/April 2, 2020 at 1:59 pm #1224128Carsten
Hi Leo, yes for mobile primarily
April 2, 2020 at 3:20 pm #1224175Leo
StaffCustomer SupportYup then the secondary navigation with linked above should be the way to go.
April 2, 2020 at 3:30 pm #1224187Carsten
Thanks, I will have a look at this, I just wonder about the title of this article, ‘Disable Secondary Navigation Mobile Menu’, when it is actually about adding an extra row of navs?
I would have expected this should be done with a Header Page Hero element, but again, I might be mixing up the two header contents
April 2, 2020 at 3:31 pm #1224188Leo
StaffCustomer SupportBy default the secondary navigation turns into a menu toggle like the primary navigation, this is to disable the toggle option so that the menu items show up normally like on desktop.
April 2, 2020 at 3:43 pm #1224199Carsten
Thanks for clarifying
April 2, 2020 at 5:15 pm #1224262Leo
StaffCustomer SupportNo problem 🙂
April 8, 2020 at 6:38 am #1231159Carsten
Hi there, now I have disabled the Secondary Navigation Mobile Menu, to create an extra row of links, under my mobile header.
Now I want to add buttons to the menu. I have viewed the options in /collection/secondary-navigation/. So is the way to go to add these links/buttons the
.botton
class for every link I want to add, in my functions.php?April 8, 2020 at 8:32 am #1231438David
StaffCustomer SupportHi there,
if you want to make those links look like buttons – read this:
https://docs.generatepress.com/article/adding-buttons-navigation/
April 8, 2020 at 11:23 am #1231669Carsten
It is more the mark-up of the links which is the problem.
I have added the
.button
class like this example to my functions.php, but it breaks my site.<a class="button" href="https://google.com">Button to Google</a>
Obviously this code need some extra tags to function?
How do I point these created links to the secondary navigation?
Thanks
April 8, 2020 at 7:25 pm #1231996Tom
Lead DeveloperLead DeveloperYou could create a Hook Element instead of using the Secondary Nav if you want full control over the HTML: https://docs.generatepress.com/article/hooks-element-overview/
If you add the
button
class to your menu items, it will add the class to the<li>
element. Then you just need to adjust the CSS to fit that markup.April 13, 2020 at 7:44 am #1237312Carsten
Hi there, I know how to create a hook element, which hook should I use for a secondary nav?
If you add the button class to your menu items, it will add the class to the
- element. Then you just need to adjust the CSS to fit that markup.
Would you please clarify what you mean, should I add this button class php in the element that I have created?
Do you have any documentation on how this markup for links should look like?
Regards
CarstenApril 13, 2020 at 8:20 am #1237470David
StaffCustomer SupportTHIS:
If you add thebutton
class to your menu items, it will add the class to the<li>
element. Then you just need to adjust the CSS to fit that markup.MEANS:
If you use this documentation: https://docs.generatepress.com/article/adding-buttons-navigation/ to add thebutton
class then it will be added to the Menus<li>
The Markup will look something like this:
<li id="menu-item-1391" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-1391 button"> <a href="https://some-site.com/some-page">A menu links label</a> </li>
And the CSS selector to style it would be:
.secondary-navigation .main-nav ul li.button a
April 13, 2020 at 10:02 am #1237619Carsten
Thanks, regarding which hook to use,
if I choose theinside_navigation
hook, the link displays in the line of the main navigation.If I choose
inside_secondary_navigation
the link is not displayed at all? -
AuthorPosts
- You must be logged in to reply to this topic.