How to query posts

https://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters

$args1 = array(
‘category__and’=>array(’22’,’28’),
‘posts_per_page’=>’1’
);

//Query
$query1 = new WP_Query($args1); ?>

have_posts() ) {
$query1->the_post();
}

//Restore original post data
wp_reset_postdata();

?>

Advertisements
How to query posts