Grow your CSS skills. Land your dream job.

WP: Exclude pages with permalinks from list-pages tag?

  • # May 4, 2009 at 1:33 pm

    I want/need to use the wp-list-pages tag for the navigation on an existing theme.
    I’d like to exclude some of the links but everything ive found said use the page id number.
    well im using permalinks and when i use the name it doesnt work.

    Anybody know how to make that happen?

    i could also live with saying just show these pages, and that might even be better as new pages are sure to be added.

    help?

    # May 4, 2009 at 3:22 pm

    Permalinks have nothing to do with it. You still need to use the page id number.
    Either include the pages you do want or exclude the pages you don’t want.

    Something like this will do the job and not affect your permalinks

    Code:
      < ?php wp_list_pages('include=3,5,7,9,11&title_li='); ?>

    Just use your own page numbers.

    # May 4, 2009 at 3:49 pm

    I’m using an old version of WP out of necessity, how do i find what the page id is?

    thanks

    # May 4, 2009 at 3:59 pm

    Figured it out, the "Edit this page" link uses the number id. if its easier to find somewhere else that’d be cool but i can find it there at least.

    # May 4, 2009 at 4:11 pm

    For some obscure reason the WP developers removed the simple access to the page id several builds ago.
    So yeah, edit this page or hover over the page link in the backend with Firefox to see the id number.

    # May 4, 2009 at 4:16 pm

    gotcha, they should fix that since the number is used in stuff like this and theres no easy way to get it. thanks for the help!

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".