Site logo

Archived topic

Using 2nd navigation in left sidebar issue

11 replies · Started by NIKOLAY on February 18, 2020

Viewing posts 1–12 of 12

Hi,

I'm using 2 navigation menus in my web. 1st one is located under header and 2nd one is in left sidebar. (My web is using sidebar/content/sidebar).

Is it possible in mobile version instead of showing 2nd navigation under content to be display under main navigation before the content?

Best regards: Nick

Lets try this.
Add the following code to the after_header hook:

<div class="second-nav-mobile hide-on-desktop grid-container">
	<?php 
	if ( function_exists( 'generate_secondary_navigation_position' ) ) {
		generate_secondary_navigation_position();
	}
	?>	
</div>

You can use a Hook Element to do that:

https://docs.generatepress.com/article/hooks-element-overview/

Works perfectly!

The only difference is that I did not use after_header hook. I use inside_side_container.

Thank you!!!

Awesome! Glad to hear that :)

Just one final question.

Any idea how to change 2nd menu to be floating left (same as above navigation) - now is on centre?

Thank you!

Try this CSS:

.secondary-navigation .menu-toggle {
    text-align: left;
}

Works perfect!

After doing new hook for 2nd menu and adding css, now bellow under the content the 2nd navigation bar did not work on mobile version anymore.

Can I just remove in mobile version not to display 2nd navigation located in left sidebar?

Thanks!

Try this:

@media (max-width: 768px) {
    .gen-sidebar-secondary-nav {
        display: none;
    }
}

Wow!!!

I have no words to describe how great you are!

This is the best online support ever!

Many Thanks for all your help.

Regards: Nick

happy to hear that !

This archived topic is closed to new replies.