'post_type' => 'page', // 'tax_query' => [ // [ // 'taxonomy' => 'category', // 'field' => 'slug', // 'terms' => 'pentecost' // ], // ], ]; $query = new WP_Query( $args ); if ( $query->have_posts() ){ echo "Within in the if nest"; while ( $query->have_posts() ){ $query->the_title(); $query->the_content(); } } //var_dump( $query ); //var_dump( $myquery ); // echo get_the_term_list( $post->ID, 'category' ); // the_terms( $post->ID, 'category', 'foo bar baz'); // $terms = get_the_terms( $post->ID, 'category' ); // // var_dump( $terms ); // foreach( $terms as $term ){ // echo $term->name;