loop hierarchical custom post type, child pages only

<?php // query only child pages of custom post type $customQuery = array( ‘post_type’ => ‘CUSTOM_POST_TYPE’, ‘posts_per_page’ => ’10’, ‘post_parent__not_in’ => array(0), ); $custom = new WP_Query( $customQuery ); if ($custom->have_posts()) : while ( $custom->have_posts()) : $custom->the_post(); ?> DO STUFF <?php endwhile; endif; wp_reset_query(); ?>

WP_Query post_tilte search in posts table

You added title inside $args[‘meta_query’] and that’s why your query doesn’t work. Checking the documentation (get_posts / WP_Query) you will find the available parameters, among them title and s. $args = array( ‘s’ => ‘apple’, ‘post_type’ => ‘product’ // // other parameters // ‘status`, ‘orderby’, ‘meta_query’, … ) $posts = get_posts($args); If you use the … Read more