[resolved] wp_nav_menu showing draft pages (4 posts)

  1. joshdd
    Posted 2 years ago #

    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?


  2. joshdd
    Posted 2 years ago #


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


  3. esmi
    Forum Moderator
    Posted 2 years ago #

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

  4. joshdd
    Posted 2 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Topic