Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was trying to set up a few pages the other day that would hold an authors information (only to be accessed from the author snippet at the bottom of posts), and obviously these pages are showing up in the <?php wp_list_pages('title_li='); ?> , I made sure of my page order (0-5 are the pages that must be there, and I set up the special pages to start with an id of 44 just in case they added some pages), and then tried <?php wp_list_pages('title_li=&exclude=44'); ?>. However, 0-5 show up, as well as 44. Any thoughts on why this is still occurring?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

it sounds from your text that you are using the number you gave it under 'page attributes' 'order'; use the page ID instead for the 'exclude'.

share|improve this answer

To exclude pages that have not been made yet, sort like future proofing your site, you can use exclude_tree for instance exclude_tree=42. This will exclude all child pages of the parent page with and ID of 42. You will have to structure a bit more code but that way you won't have to constantly update the hard-coded exclude with a post ID. The alternative would be to use just exclude with some sort of conditional array.

share|improve this answer

I have had the same issue sometimes i always but a , at the end of the number and that seems to work

share|improve this answer
    
Yeah, I found out my issue. I had my exclude set to 0,1,2,3,4 (and forgot that I had created and deleted pages in the past) so my page id's were a bit further along then I thought. –  Louis Stephens May 16 '11 at 12:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.