This lists all the top-level pages and all direct children of those pages.
One of my top-level pages has around 18 direct children, and I’m wondering if there’s a way to tell the exclude parameter to simply exclude all children of this one top-level page, rather than hard code a list all 18 pages for the exclude.
I tried something like:
It can be easily done and your not far off all you need to do is get the page id’s as the id of the page in the database not the div id. You can find the idea of page by clicking on pages and hovering over those pages and the id will be at the end of the url. You then use the exclude bit and place in comma separated id’s. The other ways are using exclude tree which gets rid of parent and hiding them with css but you should really use the first way.
49 is the page id, I think my using of # in the context I did to mean number as opposed to id was misleading.
Saying ‘exclude=49′ is not what I want though, 49 has a bunch of children pages, and I want to exclude those while keeping 49, and my thinking is I can exclude them by creating a variable that targets all of them, as opposed to doing ‘exclude=14,67,45,34,etc..’ in the event that additional children pages are created later this would prevent having to go back in and add those pages to the php.
As an easier way of identifying id numbers for post, pages, etc, try the Reveal IDs plugin — it shows the id numbers (post, pages, categories, you name it) in the Dashboard interface. Invaluable for building loops easily.