Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to pull post if only in both categories Reply To: How to pull post if only in both categories

#196488
Senff
Participant
$args = array(
   'category__and' => array(1770730, 690754) 
);

$the_query = new WP_Query( $args );

if( $the_query->have_posts() ): 
    while ( $the_query->have_posts()) : $the_query->the_post(); 
        get_template_part('content'); 
    endwhile; 
endif; 

wp_reset_query();