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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s