Excluding Pages not working

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?

Related posts

Leave a Reply

3 comments

  1. 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.