php - Wordpress Pulling in multiple posts that share the same category -
i'm trying pull in thumbnails posts come category id "theme 01" aka id 117 , category called "ingredients" aka id 46. far got work want pull in posts match "theme 01" , "recipes". posts match "theme 01" , "chef" etc. idea. tried adding category id array no luck.
<?php $my_query_args = array('posts_per_page' => 6, 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => array( 117, 46, 65 ), 'operator' => 'and' ) ) ); $my_query = new wp_query( $my_query_args ); if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post(); ?> <li> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(46,65)); ?></a> </li> <?php endwhile; endif; wp_reset_postdata(); ?>
Comments
Post a Comment