• I have an odd problem with wp_nav_menu effecting the post order on subsequent post queries made throughout the site I’m working on. I’m using a very heavily modified commercial theme and wp_nav_menu is included within the first few lines of header.php as normal. This is the particular code (which seems normal to me):

    wp_nav_menu( array( 'container' => '', 'menu_class' => 'nav1', 'theme_location' => 'primary' ) );

    The problem is that ANY post query that is made after the header has been included returns posts ordered by menu_order no matter what orderby argument has been set for both query_posts() and individual WP_Query instances.

    I’ve narrowed it down to the nav menu because if I simply remove the wp_nav_menu function from header.php, all subsequent post queries order by date descending as expected. Any attempt to manually set orderby=date&order=DESC is completely ignored if I have the wp_nav_menu in the header.

    This has got me stumped. Anybody experienced anything like this and know what might be causing it?

Viewing 1 replies (of 1 total)
  • As this is a commercial theme, we cannot really help. You need to seek support from the theme vendors. But I can say that it’s highly unlikely that the issue is wp_nav_menu() itself. Its far more likely to be something funky going on (with a secondary loop perhaps?) in header.php.

Viewing 1 replies (of 1 total)
  • The topic ‘Odd problem with wp_nav_menu’ is closed to new replies.