Site logo

Archived topic

How to have a different navigation for home page?

4 replies · Started by K Saravana on October 27, 2016

Viewing posts 1–5 of 5

Hello!

I have installed GP theme and recently purchased the premium add-ons and am setting up my website.

Could you please help me with this query. I need a different primary navigation for the home page. I want the home page menu to be floating right, while the menu on the rest of pages to be available below the header. Is it possible?

Thanks

K S Baskar

Hi there,

That's actually a really tough question as it's very hard to change options on specific pages only unless a filter is present. In this case, there's no filter.

Let me think about this and I'll get back to you :)

Alright, I was coming up with all of these complicated ways of doing this, and decided I should just add a filter to the theme to make it easy.

So in, GP 1.3.41, you'll be able to do this:

add_filter( 'generate_navigation_location','tu_move_navigation' );
function tu_move_navigation( $location )
{
	if ( is_front_page() ) 
		return 'nav-float-right';
	
	return $location;
}

If you don't want to wait for 1.3.41, you can grab the latest files on GitHub: https://github.com/tomusborne/GeneratePress

Hello Tom

Thank you very much for adding the filter.

K S Baskar

Thanks for the push - been wanting to do that for a while now :)

This archived topic is closed to new replies.