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?
Leave a Reply
You must be logged in to post a comment.
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’.
To exclude pages that have not been made yet, sort like future proofing your site, you can use
exclude_tree
for instanceexclude_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-codedexclude
with a post ID. The alternative would be to use justexclude
with some sort of conditional array.I have had the same issue sometimes i always but a
,
at the end of the number and that seems to work