Skip to content

Instantly share code, notes, and snippets.

@imranismail
Created April 8, 2015 07:03
Show Gist options
  • Save imranismail/dbdeeac4211633d58892 to your computer and use it in GitHub Desktop.
Save imranismail/dbdeeac4211633d58892 to your computer and use it in GitHub Desktop.
WP_Query for gettings multiple post type in multiple taxonomy
get_posts([
'post_type' => ['headline', 'event'],
'numberposts' => 5,
'tax_query' => [
'relation' => 'OR',
['taxonomy' => 'event-category', 'field' => 'slug', 'terms' => 'featured'],
['taxonomy' => 'headline-categories', 'field' => 'slug', 'terms' => 'featured']
],
'order' => 'DESC'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment