WordPress.org

Support

Support » How-To and Troubleshooting » Excluding permalink Pages from Nav

Excluding permalink Pages from Nav

  • I’m trying to exclude a specific page link from the navbar but I’m having trouble finding the right code. All examples I have seen are for none permalink pages which obviously will not work for me. I figure it’s something simple but I’m new to wordpress.

    I have tried a few variations that haven’t worked.
    The page slug is “partner-links”
    Here is the code from my template.

      <li class=”<?php echo $highlight; ?>”>“>Home
      <?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’ ); ?>

    Any help would be appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Just take a closer look at the parameters (hint: exclude)
    http://codex.wordpress.org/Template_Tags/wp_list_pages

    There seems to be some sort of issue with parts of this site right now. I’m getting a server error for that link. I did a search and get the same thing.

    Anyway I did use &exclude=partner-links in multiple spots. Yes i switched the & from side to side when it needed to be moved.
    I’ve done the following aswell as a few other things none of which did anything:

    <li class=”<?php echo $highlight; ?>”>”>Home
    <?php wp_list_pages(‘exclude=partner-links&sort_column=menu_order&depth=1&title_li=’ ); ?>

    <li class=”<?php echo $highlight; ?>”>”>Home
    <?php wp_list_pages(‘sort_column=menu_order&exclude=partner-links&depth=1&title_li=’ ); ?>

    <li class=”<?php echo $highlight; ?>”>”>Home
    <?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=&exclude=partner-links’ ); ?>

    You exclude Pages by ID#, not by slug.

    How do I findout what the page ID is? I looked in the DB because I was going to try that just incase it might work but I see no references to pages there.

    Edit: Duh Me I found the page ID in admin right next to the page lol. I’ll test it out.

    Thanks for the help 🙂

    manage > pages

    look in the id field.

    Sorry for being a dolt. Works like a charm 😀

    Thanks again for the smack in the back of the head to wake me up.

    Jaks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Excluding permalink Pages from Nav’ is closed to new replies.
Skip to toolbar