• Resolved michaelmorning

    (@michaelmorning)


    I am trying to prevent a few pages from showing up in the menu navigation at the top of the page. From all the online tutorials I’ve read, I’m finding that I just need to enter an exclude code for the pages in question. However, I can’t find the code <?php wp_list_pages();?>

    Most tutorials say this should be located within the Theme Header (header.php) area, but I’m just not seeing it.

    Can anyone help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Many files under your theme directory could have “wp_list_pages” like single.php, head-id.php, index.php.

    Search them all.

    Hi There,

    You can use take page-id and you can give display none to some of the menu which you do not want to show in certain page.

    Please let us know if we are understanding you fully or if perhaps this is not what you meant.

    We look forward to your response.

    Thanks

    Thread Starter michaelmorning

    (@michaelmorning)

    @StyledThemes — actually, I want certain pages to not appear within the navigation menu. For instance, I have a page that has a link to an ebook that people can buy. Obviously, I don’t want that page directly available to the public or showing up on navigation menus.

    This is a pain because a lot of other WP themes have this functionality built in.

    Thread Starter michaelmorning

    (@michaelmorning)

    @webkong — I ran a search using the browser search function in every section of editor and never found this string: wp_list_pages

    Any ideas what on earth is up with this theme? Is there another way of adding this code?

    Hi There,

    If you are searching the code for the menu in theme core file, then you can get it in the header.php, there you can find wp_nav_menu function to list the pages and please use the child theme to make changes the theme core file otherwise your changes will lost on theme update.

    If you want to secure your pages from public then you can make certain page password protected. For this follow this steps:

    Go to Dashboard => Pages => Then select(click in the edit) the pages in which you want to keep the password => After you enter inside the pages then you can see Visibility in the right sidebar in which you need to click in the edit => And select the password protected then keep your password and click in ok and update your page.

    Thanks

    Thread Starter michaelmorning

    (@michaelmorning)

    Thank you so much for the information. Fortunately, I figured out that the theme can create a menu and you can then pick and choose which pages you want in that new menu and then make it primary to override the default navigation menu. I had tried this before, but didn’t realize there was an extra step involved (previously, it had simply blacked out the existing navigation structure). Thank you again for your assistance!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Need to Exclude Pages from Navigation Menu’ is closed to new replies.