WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_nav_menu showing draft pages (4 posts)

  1. joshdd
    Member
    Posted 12 months 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?

    Josh.

  2. joshdd
    Member
    Posted 11 months ago #

    Hello?

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

    Thanks,
    Josh

  3. esmi
    Forum Moderator
    Posted 11 months ago #

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

  4. joshdd
    Member
    Posted 11 months 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.

    Josh.

Reply

You must log in to post.

About this Topic