How to query for posts (hierarchical custom post type) that have children but are NOT top level?
You can use filters to modify the SQL. I added something unique in the post_type so I could filter only this query and not change anything else. The query for example $query = new WP_Query(array(‘post_type’=>’something_unique_for_filter’)); And the filter function custom_where($where, $query) { global $wpdb; if(false !== strpos($where, ‘something_unique_for_filter’)) { $where = ” AND post_type=”page” AND … Read more