- This topic is empty.
-
AuthorPosts
-
May 25, 2011 at 5:40 pm #32872DogsGhostMember
My nav is currently generated by:
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:
49 being the page # of the top-level parent w/the 18 children. But this removed the top-level page from the nav.
May 26, 2011 at 12:53 am #75320matthewfowlesMemberHi
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.
Here is the function reference which shows you how to do this:
Your text to link…Hope this helps!
May 26, 2011 at 2:07 am #75288DogsGhostMember49 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.May 26, 2011 at 5:00 am #75281ddliuMemberYou may try these plugins
http://wordpress.org/extend/plugins/exclude-pages/
http://wordpress.org/extend/plugins/simply-exclude/
yet I’m not sure they will work for you.May 26, 2011 at 7:40 am #75262matthewfowlesMemberyou can just exclude the children pages all you have to do is get their id not the parent and yes you can save them into a variable if you wish!
May 26, 2011 at 1:24 pm #75225ccc630MemberAs 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.
May 26, 2011 at 3:41 pm #75228jacorreParticipantCould you instead list only the top level pages and then when on that page, you could include the menu for subpages?
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.