[Resolved] Exclude All Child Pages from WP_Query
I’m trying to figure out how to exclude all child pages from WP_Query?
Here is what I am doing:
<?php $my_query = new WP_Query("post_type=page&posts_per_page=9&orderby=menu_order&order=ASC"); ?>
It’s listing every page, but what I want is it to only show top-level pages and exclude all child pages. I was expecting the same functionality that wp_list_pages has with depth=1.
Thanks for the help.
- The topic ‘[Resolved] Exclude All Child Pages from WP_Query’ is closed to new replies.