cat_ID : $object->slug; $query_args = array( 'post_type' => $args['post_type'], 'post_status' => 'publish', 'posts_per_page' => -1, "{$tax_name}" => $term_id, 'meta_query' => array( 'relation' => 'OR', // include if this key doesn't exists array( 'key' => '_yoast_wpseo_meta-robots-noindex', 'value' => '', // This is ignored, but is necessary... 'compare' => 'NOT EXISTS' ), // OR if key does exists include if it is not 1 array( 'key' => '_yoast_wpseo_meta-robots-noindex', 'value' => '1', 'compare' => '!=' ), // OR this key overrides it array( 'key' => '_yoast_wpseo_sitemap-html-include', 'value' => 'always', 'compare' => '=' ) ) ); $posts = get_posts( $query_args ); $output .= "