How to display posts from 2 categories in the same Custom Taxonomy
-
I figured out how to display posts from multiple custom taxonomies and how to pull posts from a specific category in a taxonomy, but I can’t for the life of me figure out how to display posts from 2 categories within a single taxonomy.
The code below shows posts from the News post type and from the General News category in the News Type taxonomy. How can I modify this to add posts from the Press Release category in the same taxonomy?
<?php $args=array( 'post_type' => 'news', 'news-type' => 'general-news', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><?php the_title(); ?></p> <p><?php the_content(); ?></p> <?php endwhile; } wp_reset_query();?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to display posts from 2 categories in the same Custom Taxonomy’ is closed to new replies.