Excluding a page in WP nav list

Discussion in 'PHP' started by AHA7, Feb 12, 2007.

  1. #1
    Hello,

    My WP theme uses the following code to display the top nav links: <?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'.$pages_to_exclude)?>

    How can I exclude a page using this function?
    Do I just add ID of the page I want to exclude after the $pages_to_exclude, example: $pages_to_exclude='7' or what?
     
    AHA7, Feb 12, 2007 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Try this:
    wp_list_pages('exclude=1,2,3,4,5,6&title_li=&depth=1&'.$page_sort)?>

    Just type in each page number you want to exclude. Use a comma to seperate multiple pages.
     
    jestep, Feb 12, 2007 IP