Archived topic
CSS classes for custom nav menu
3 replies · Started by Matthew on August 11, 2020
I added the following code in my template file for a new navigation menu where I want it to appear:
<?php
wp_nav_menu( array(
'theme_location' => 'gallery-menu',
'container_class' => 'custom-menu-class' ) );
?>
I need to use GP's existing menu class(es) so the menu becomes functional and is consistent with my main and secondary menu. But I'm not sure what and how to add the required CSS.
thanks,
Hi there,
So you are trying to add a third menu?
If so this post might help:
https://generatepress.com/forums/topic/add-third-navigation-menu-gpp-1-8/#post-873715
I used the CSS in that resource:
.third-navigation ul {
list-style-type: none;
margin: 0;
}
.third-navigation ul {
display: flex;
justify-content: center;
}
.third-navigation a {
padding: 0 20px;
line-height: 40px;
color: #a51c30;
}
Which provides a nice basic centered layout and removes the list appearance. But how can I bring the styling elements of the default (primary and secondary) GP navigation menus. I want this third menu to look like those. I might tweak it afterwards but want to use them as a base.
Thanks,
You would just need to style it with CSS.
Can you link us to the page in question if you need further help on this?