I’m looking for a snippit/function that will list the child pages of a specific page (I guess by page ID) but not necessarily when you are on that page or a child of that page. The parent page (Parents Area) and its child pages are listed below:
Parents Area
- Term Dates
- Calendar
- School Blog
- Letters to Parents
- Attendance
I want to be able to be on any page of the website, specifically within single posts and post archives but be able to list out just the children of the parent page “Parents Area”.
To list subpages of a particular page, use
wp_list_pages
withchild_of
argument.Maybe I didn’t quite get what was asked for, but what’s wrong in using
wp_list_pages
?Here is a sample code (which most probably has to be customized and adapted to fit your needs):
Maybe you have to adapt the HTML list as well, if you want a hierarchical list of two levels etc.