WordPress.org

Forums

Excluding permalink Pages from Nav (7 posts)

  1. jaks
    Member
    Posted 8 years ago #

    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.

  2. moshu
    Member
    Posted 8 years ago #

    Just take a closer look at the parameters (hint: exclude)
    http://codex.wordpress.org/Template_Tags/wp_list_pages

  3. jaks
    Member
    Posted 8 years ago #

    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' ); ?>

  4. moshu
    Member
    Posted 8 years ago #

    You exclude Pages by ID#, not by slug.

  5. jaks
    Member
    Posted 8 years ago #

    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 :)

  6. jayoh
    Member
    Posted 8 years ago #

    manage > pages

    look in the id field.

  7. jaks
    Member
    Posted 8 years ago #

    Sorry for being a dolt. Works like a charm :D

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

    Jaks

Topic Closed

This topic has been closed to new replies.

About this Topic