Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = new WP_Query( array(
- 'post_type' => 'books', // name of post type.
- 'tax_query' => array(
- array(
- 'taxonomy' => 'fiction', // taxonomy name
- )
- )
- ) );
- while ( $query->have_posts() ) : $query->the_post();
- // do stuff here....
- endwhile;
- /**
- * reset the orignal query
- * we should use this to reset wp_query
- */
- wp_reset_query();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement