CSSgirl Dev & Design - Master of CSS and Dirty Diapers Faceb
a guest Apr 7th, 2014 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- $args = array(
- 'post_type' => array('post_type_one', 'post_type_two'), //our two post types
- 'tax_query' => array(
- 'relation' => 'OR',
- 'taxonomy' => 'tax_name_one', //name of taxonomy where we only want to look for posts in one taxonomy.
- 'field' => 'slug', //can use slug, or ID. slug is easier here as we know they are not going to change.
- 'terms' => array( 'specific_term' ), // the specific slug of the term we are looking for
- 'operator' => 'IN', // the posts must be in this term
- 'taxonomy' => 'tax_name_two', //name of second taxonomy where we want to show all items
- 'field' => 'slug',
- 'terms' => array( 'event', 'in-the-news', 'newsletter', 'press-release', 'staff-presentation' ), //all the terms from the second taxonomy
- 'operator' => 'IN',
- 'order' => 'DESC',
- 'posts_per_page' => 10
RAW Paste Data