I solved the problem with the page, the correct answer is ptriek’s comment below.
Well I’m having a bit of an odd problem here, wp_nav_menu works on all pages EXCEPT my category pages (probably my archive page too but there’s no links on the website to the archive pages so that’s alright).
Although there is archive.php in my theme files, this controls what is displayed on category, tag, archive, author, etc. pages.
I just don’t understand why, since every page uses the same header.php to display wp_nav_menu, it won’t show up for the category pages.
Am I overlooking something? I’ve been banging my head against my keyboard trying to figure this out and it just won’t work!
Using a very simple code: <?php wp_nav_menu('container_class=menu-header&theme_location=primary'); ?>
I had the same problem, but with a newer version of WordPress (3.7.1).
On pages with custom taxonomies of custom posts, the wp_nav_menu was not shown. The solution below worked for me.
in functions.php of the theme:
Implode’s answer is right and helped me a lot. I tried to implement a hook (
pre_get_posts
) for avoiding to display posts of subcategories. My hook worked well despite of no more Nav-Menus.So, when change the
tax_query
you have to avoid doing this for the query withpost_type == 'nav_menu_item'
.Answer by Implode solve issue only if you are not using other queries like ‘meta_key’ even . I found complete solution here.
This one works for me. The answer found in this link on the second last post/comment: https://wordpress.org/support/topic/wp-nav-menu-dissapears-in-category-pages-1/?replies=15#post-1859168
Just need to add this on the theme’s function.php file