Archived topic
header : logo on left + secondary menu & widget on right
12 replies · Started by Sarah on December 11, 2020
So this seems to be a layout I use quite a lot but I have not managed to get it quite right
so logo in header aligned left
then to the right I would like a widget (which contains social media icons) and then below that the secondary menu
so its a 2 cols header with right side contains menu and widget on top of each other
I can do it using the secondary menu as a widget .. but I would really rather used the secondary menu float right and a widget standalone
possible?
I can see how to get 3 cols..(https://generatepress.com/forums/topic/nav-in-header-plus-widget/#post-833747) logo 2nd menu widget but not 2
thank you
Sarah
Hi there,
can you share a link to your site so i can see the current layout ?
yes sorry forgot to post the link!
Is this what you are after?
https://docs.generatepress.com/article/header-examples/#example-8
No Sorry that is the primary navigation floated under a search bar widget - I want the secondary navigation under a widget instead
Are you going to be using the sticky navigation?
If not the two navigations are actually interchangeable :)
meaning I can use sticky instead of secondary? - does that sit on the right simpler than the secondary one? or did you mean instead of the primary?
I am happy to swap from secondary to sticky
Is it simple to get that as a widget or at least sit to the right of the header with a widget above it ?
did you see the link I sent in - that shows what I mean - but you can see the header is currently in 3 cols whereas I want the secondary menu under the social media and tel widget
does that make sense?
thank you
Sorry - I meant that you can actually swap the primary and secondary navigation as they should have the exact same option except you can only make the primary navigation sticky.
So if you don't plan on using the sticky navigation, then simply set your current primary navigation to secondary and set the secondary navigation to primary then that solution I linked would work :)
If not we can tweak the solution to work for secondary navigation as well.
Also just to make sure, the solution I linked is the layout you are after...right?
ok that makes sense - thank you - I will give that a go - as yes that is the layout style I was after and I had not realised those menus were interchangeable
I will report back if that works
Thanks!
Sounds good let me know :)
Hi Leo, David - just to let you know that this worked...
I made primary menu become - secondary menu
I then made the old secondary - menu primary
used the PHP in functions file from link
add_action( 'wp', function() {
remove_action( 'generate_after_header_content', 'generate_do_header_widget' );
add_action( 'generate_before_navigation', 'generate_do_header_widget', 20 );
} );
add_action( 'generate_before_navigation', function() {
echo '<div class="primary-navigation-wrapper">';
}, 15 );
add_action( 'generate_after_navigation', function() {
echo '</div>';
} );
and also then I had to of course swap css and styles across via colours/typography etc
and finally the only thing that was different was the secondary sub menu width - there is no where to add this in GPP - so manually inserted it using
.secondary-navigation ul ul {
width: 350px !important;
}
that gave me exactly what I was looking for - thank you!
Sarah
No problem :)