Support » Fixing WordPress » wp_nav_menu showing draft pages

  • Resolved joshdd

    (@joshdd)


    Why are draft and private pages appearing in my menu?

    I haven’t tested it on top level pages, but child pages are still appearing even when their status is ‘draft’ or visibility is ‘private’.

    I have this in the functions.php
    register_nav_menu( 'headmenu', 'Header Menu' );

    And this in my header.php
    <?php wp_nav_menu( array( 'theme_location' => 'headmenu', 'menu_class' => 'top-menu' ) ); ?>

    Am I doing something wrong?

    Josh.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello?

    Can anybody tell me why draft and private pages are showing in my nav menu? And how to fix it?

    Thanks,
    Josh

    esmi

    (@esmi)

    Forum Moderator

    Can you replicate the problem using the default Twenty Thirteen theme with all plugins deactivated?

    No – doesn’t do it on Twenty Thirteen or Twenty Twelve – but having switched back to my custom theme, it seems to be working now!?!

    That’s absolutley bizarre!

    I had emptied cache, deleted cookies, spent hours trawling through the code and other peoples blogs working out why it happened, and nothing – but simply switching theme and switching back again seems to of fixed it!

    Thanks for your help Esmi – even if the outcome wasn’t exactly what you had expected!

    I’ll give you a chance to reply then mark this as resolved.

    Josh.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_nav_menu showing draft pages’ is closed to new replies.