Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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):

Menu: http://politichicks.tv/column/

No Menu: http://politichicks.tv/category/videos

share|improve this question
add comment

2 Answers 2

Have you tried using the wp_nav_menu() function? here is the wp_nav_menu reference.

Instead of this:

<?php if ( has_nav_menu( 'primary' )) {
                                if(!getMainMenu('primary')){
                    /*$backup = $wp_query;
                    $wp_query = NULL;
                    $wp_query = new WP_Query(array('post_type' => 'post'));*/
                    getMainMenu('primary');
                    /*$wp_query = $backup;*/
                }
                            }

I wold try this:

<?php if ( has_nav_menu( 'primary' )) {     
    wp_nav_menu( array('menu' => 'primary' ))
}
share|improve this answer
    
That's essentially what's happening right now, but yes, I've tried explicitly calling wp_nav_menu( array('menu' => 'primary' ) ). In fact, the code as seen in header.php is a response to the wp_nav_menu() not working. –  Alan Breck Nov 27 '13 at 21:57
add comment

Have you checked your archive.php or category.php file? If you use the same header.php the code should be displayed.

share|improve this answer
    
Both the post and custom post types are using the same template file which uses the same header file. –  Alan Breck Nov 27 '13 at 21:55
    
This is really more of a comment than an answer isn't it? –  s_ha_dum Dec 8 '13 at 4:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.