I have a site whose navigation disappears on category pages for posts in the âpostâ post type, but not for posts in any of my custom post types. The âpostâ post type and post of the custom post types use the same template file for theirs archives and headers â no differences. The menu is using the wp_nav_menu function. Example links below (again, same template files being used):
2 comments
Comments are closed.
I know this is an old question but seems that is still unresolved. As @Milo said you may have an incorrect
pre_get_posts
implementation.Most people do this like this (example):
But we must change the line:
$post_type = $post_type;
and pass'nav_menu_item'
to the$post_type
in order to menu to display, as follow:I hope this help people who do this wrong and sorry for my bad English.
Have you tried using the
wp_nav_menu()
function? here is the wp_nav_menu reference.Instead of this:
I wold try this: