Attempting to get number of grandchildren of page in WP_Query loop

Found a solution! $inner_query = new WP_Query(array( ‘post_parent’ => $parentid, ‘post_type’ => ‘location’, ‘posts_per_page’ => -1 ) ); $countchildren = $inner_query->post_count; $counterz = 0; if ( $inner_query->have_posts() ) { while ( $inner_query->have_posts() ) { $inner_query->the_post(); $posterid = get_the_ID(); $inner_inner_query = new WP_Query(array( ‘post_parent’ => $posterid, ‘post_type’ => ‘location’, ‘posts_per_page’ => -1 ) ); $counterz = … Read more

Related posts by taxonomies does not work , what could be the reason?

Your tax_query is using an invalid field type. Try: $args = array( ‘post_type’ => ‘films’, ‘post__not_in’ => array($post->ID), ‘showposts’=> 3, ‘tax_query’ => array( array( ‘taxonomy’ => ‘actors’, ‘field’ => ‘term_id’, ‘terms’ => $tax_IDs ) ) ); See the Taxonomy Parameters of WP_Query for more options if that doesn’t wok.