daily pastebin goal
17%
SHARE
TWEET

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!
  1. $args = array(
  2.   'post_type' => array('post_type_one', 'post_type_two'), //our two post types
  3.   'tax_query' => array(
  4.   'relation' => 'OR',
  5.       array(
  6.        'taxonomy' => 'tax_name_one', //name of taxonomy where we only want to look for posts in one taxonomy.
  7.        'field' => 'slug', //can use slug, or ID. slug is easier here as we know they are not going to change.
  8.        'terms' => array( 'specific_term' ), // the specific slug of the term we are looking for
  9.        'operator' => 'IN', // the posts must be in this term
  10.       ),
  11.       array(
  12.        'taxonomy' => 'tax_name_two', //name of second taxonomy where we want to show all items
  13.        'field' => 'slug',
  14.        'terms' => array( 'event', 'in-the-news', 'newsletter', 'press-release', 'staff-presentation' ), //all the terms from the second taxonomy
  15.        'operator' => 'IN',
  16.       ),
  17.     ),
  18.   'order' => 'DESC',
  19.   'posts_per_page' => 10
  20. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top