I have a Page structure that looks like this:
Home
Page1
Page1a
Page1b
Page1b-a
Page2
Page3
Page3a
Is there any way to get only the second level pages (Page1 , Page2 and Page3)??
Thanks in advance!
I have a Page structure that looks like this:
Home
Page1
Page1a
Page1b
Page1b-a
Page2
Page3
Page3a
Is there any way to get only the second level pages (Page1 , Page2 and Page3)??
Thanks in advance!
You must be logged in to post a comment.
Is Home an actual Page? If so you query where
post_parent = id of Home
. Are you writing a query directly against the database or using wp_list_pages?wp_list_pages has a child_of parameter:
EDIT: Can use get_pages to pull back an array of pages, pretty much same parameters as wp_list_pages:
http://codex.wordpress.org/Function_Reference/get_pages