Site logo

Archived topic

primary menu inside the content

11 replies · Started by Daniele on March 27, 2019

Viewing posts 1–12 of 12

Hi there,

This should be pretty easy.

Try this PHP:

add_filter( 'generate_navigation_location', function() {
	return 'custom';
} );

add_action( 'generate_before_main_content', function() {
	if ( function_exists( 'generate_navigation_position' ) ) {
		generate_navigation_position();
	}
}, 1 );

Hi Tom,
it seems working properly just on pages (please see http://www.80s.it/contatti/ ) but on the homepage the menu is hidden by the content and in blog pages the menu is showed in the header.

I tried to put your code in a hook (i thought the hook would be the easiest way to show the menu, even because in the future i could choose to use it on the top of the sidebars) but it doesn't work at all...

:D It is just as perfect as usual.

Just to be clear, i've added the code inside the functions.php file, but i was just figuring out if that code, modified like that


add_filter( 'generate_navigation_location', function() {
	return 'custom';
} );

add_action( 'generate_before_right_sidebar', function() {
	if ( function_exists( 'generate_navigation_position' ) ) {
		generate_navigation_position();
	}
}, 1 );

would easily work as well in other part of the website using hooks.
I'll try.

Thanks again and have a nice day,
Daniele

Glad I could help! :)

This code is not working for my themes. This is the website https://www.gulfstatesoftware.com/.
First I use function.php then I'm using code snippet. But nothing works.
-Thanks

Looks like process is change with the development of theme.
-Thanks a lot.

Sounds good.

Sorry , I disable the navigation header , but now if I past the code in function.php, they navigation bar went out.

Hi there,

this is quite an old topic and since then there have been some changes... and i am not sure if that code is what you would need today - the code is removing the nav from its current location and placing it before the Right Sidebar... which your site is not using.

Could you raise a new topic and explain exactly where you want the navigation to be positioned and we'll work that out

This archived topic is closed to new replies.