I don’t understand the distinction you are making between ‘sublevel’ query and ‘toplevel’ query, but this is how I pull children for a page.
$children = get_children(
array(
'post_parent' => $servid,
'post_type' => 'page',
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC'
)); ?>
Or…
$page_children = get_pages(
array(
'child_of' => $post->ID,
'post_type' => 'page',
'sort_column' => 'menu_order',
'order' => 'ASC'
));
In both cases I am sending the parent post’s ID as the first parameter.
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- WP_Query vs get_posts
- Get posts by meta data OR title
- Meta Query with date and time on the same Day before given time
- How to find out what “Blog pages show at most” is set to [duplicate]
- How do you Query posts with nothing in common?
- Serve specific “template” page at any URL that ends in its slug
- add active class based on permalink and url
- Display custom tags on pages that have a specific page parent
- Reset WordPress Post Query to default
- Get all posts which was posted on X Days WordPress
- get_posts output always same post
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- complex get_posts() query to select child pages
- Posts query according to meta box date
- Determine if ID is page or post and query the ID
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Facing problem with tax_query results
- Ordering Posts by parent category, name ascending
- When should you use WP_Query vs query_posts() vs get_posts()?
- get contents and permalink from a specified page
- WordPress pagination returns the same posts
- When to use WP_query(), query_posts() and pre_get_posts
- Get post ids from WP_Query?
- Nested meta_query with multiple relation keys
- Some doubts about how the main query and the custom query works in this custom theme?
- Page template query with WP_Query
- Wp get all the sub pages of the parent using wp query
- How to display page content in a page template?
- How to query for most viewed posts and show top 5
- WP Query where title begins with a specific letter
- How to use the_posts_navigation for wp_query and get_posts?
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- Get posts from Network (Multisite)
- How to order by post_status?
- Using get_posts vs. WP_Query
- Delete all posts from WordPress except latest X posts
- Using OR conditions in meta_query for query_posts argument
- Query Posts in a Predefined Order
- Sanitation needed for WP_Query or get_posts calls?
- Differences Between WP_Query() and get_posts() for Querying Posts?
- Order posts by ID in the given order
- Get Recent Posts by Date in Multisite
- get_posts with multiple categories
- get_template_part in for loop
- Use of caller_ get_ posts
- Query Multiple Post types each with own meta query
- How-to exclude terms from the main query the most performant way?
- Get posts by menu ID
- Get the number of posts from the current page results
- Does WordPress generate an automatic page for post formats?
- Is it possible to select against a post’s parent’s fields with WP_Query?
- WordPress Custom Query to show posts from last x years
- Query all posts where meta value is empty
- Query Custom Meta Value with Increment
- How to know which one is the main query?
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- Get_post() with meta_key when compare is a date
- Perform query with meta_value date
- Using is_main_query to select custom post type on certain page
- WP_Query ordered by custom field that is a date string?
- get_posts not finding argument: post_name
- get query’s query string
- How to get previous 10 days post from a specific date – WP Query
- get_the_title($postID) OR get_the_title()?
- Get posts with condition on comment meta value
- Retrieving 3 latest post from each of 5 different custom post types
- Display Posts by modifying the where clause only for my query
- Function to check if author has posted within the last x days
- How do I create my own nested meta_query using posts_where / posts_join?
- Use post__in and post__not_in together?
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- Best practice for multiple queries on page
- Modify theme to get page excerpts on front page
- What should I use, get_posts or wp_query for less CPU load?
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- How to get post from all Blog Multisite to the Main Site?
- How to Get All Posts but the Private ones?
- Single page theme that uses pages for the content
- Trying to list out child pages with WP_Query
- WP Query post meta value
- Get all posts without tags
- how to display active, upcoming and past event with featured listing with pagination
- get_posts() seemingly ignoring post_type
- Can not switch the queried post in pre_get_posts hook
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Count posts returned by get_posts in external PHP script
- Order by menu structure
- Targeting specific pages in the loop
- Multiple search queries on one page
- Trying to check and see if a post has a featured image outside of the main loop
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- WP_query category__in not working, only pulls from first category
- Pass the same object to multiple widgets in a template with one query
- What are the differences between “Latest Posts” and “Static Page”?
- Retrieve or Query Pages by ID
- Quickest way to get last or oldest post date – WP Query
- SELECT * FROM $wpdb->posts WHERE ID > 160
- WP query exclude post within the last month / only show over 1 month old