I am using WordPress 3.5. My query is,
$args = array(
'post_type' => array('product', 'comic', 'magazine'),
'taxonomy' => 'Genres',
'term' => 'hot',
'posts_per_page' => 10
);
$the_query = new WP_Query( $args );
// The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
endwhile;
// Restore original Query & Post Data
wp_reset_query();
wp_reset_postdata();
This gives the exact result that I want but,
$args = array(
'post_type' => array('product', 'comic', 'magazine'),
'taxonomy' => 'Genres',
'term' => array('hot','home'),
'posts_per_page' => 10
);
$the_query = new WP_Query( $args );
// The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
endwhile;
// Restore original Query & Post Data
wp_reset_query();
wp_reset_postdata();
This is not working.
I’m slightly surprised that the first would work, because it’s
terms
, notterm
. Anyway, the correct way to do this is: