$args = array(
'post_type' => 'post',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'channel',
'field' => 'slug',
'terms' => array( 'news', 'comedy' ), //this is by slug
),
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => array( 103, 115, 206 ), //this is by id
)
)
);
$query = new WP_Query( $args );
That could be great if you use WP_Query than query_posts. But result are the same. WP_Query is more flexible :). Don’t forget to check more in deep about query.
Related Posts:
- Combine two taxonomies in a hierarchical tree
- Use tag interface for hierarchical taxonomy?
- How can I select a primary category?
- Using URL parameters, list posts from category and custom taxonomy
- Using categories & “stickyness” together
- Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?
- Different templates for parent and children categories/taxonomies
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- How to convert regular categories to custom taxonomy?
- Select category in custom query
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting WordPress custom taxonomy/category?
- Display empty taxonomy terms with get_terms()
- Return category slug / title from category ID
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Order Taxonomy Term by date created
- How to get the number of child categories a specific parent category has?
- Exclude category from loop not working
- How can I convert some categories to a custom taxonomy?
- Get multidimensional array that reflects category hierarchy
- If statement within PHP echo
- Taxonomies for WordPress Media Library [duplicate]
- Specifying multiple categories in URL (permalink)?
- Should the actual /category/ directory be 404? Is that normal WP behaviour
- Limit number of terms that a custom taxonomy can save per custom post type
- Post count for category and tag
- Can you pre-check wordpress categories?
- Change existing taxonomy settings when using custom taxonomy
- Checking for two categories in query_posts
- How to query post like normal search would do. within search.php page
- How to get the id from the custom category?
- How do I call posts with a certain tag?
- Show a Category X’s custom post type on Category X archive page?
- Modify WordPress SQL Query to pull from within a category
- How to organize custom categories for filtering and selecting
- Custom sub taxonomy order by
- How to edit this code to get the categories in achieve page?
- Categories overview that links to page displaying posts
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Get all media categories
- Get posts from specific taxonomy term
- Set colors depending on category
- How do I query_posts in cat=1 AND not in cat=2
- List all posts in a category with query_post() function
- Why custom taxomony not showing when create a post?
- Show the latest post from child category?
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- query_posts not reading correct categories
- Pagination for query_posts();
- custom page for custom Taxonomy
- function query_posts disabling current_page_menu class
- Custom page category taxonomy 404
- Filter By Category Dropdown List With Custom Taxonomies
- Is it possible to create an alias/custom taxonomy for a category name?
- Same menu for different taxonomies to reach different content
- Showing HTML if Post is In Certain Taxonomy Term
- I need to exclude from a query a category and a few custom taxonomies
- Category link redirect to custom template page instead of index.php?
- How could I write a get_categories_by_year() function?
- Assign a custom post to a custom taxonomy based on custom field value
- PHP dynamical conditional post display
- Posts of specific category on page and excluded from index.htm
- new WP_Query issues
- Displaying links to all posts of the same category on the post page
- Post not found when filtered by category ID
- Custom Fields Value As Taxonomy
- How to get posts using category slug in ClassiPress?
- Show posts from category specified using a custom field
- query_post problem
- List taxonomy terms assigned to a post in hierarchical view
- Page category filter in admin dashboard
- Automatically add custom taxonomy to posts in a category
- How to set the same base url for two different taxonomies?
- Ordering terms whilst in loop
- When creating a new product, auto assign it to all custom taxonomy woocommerce
- How can i echo next and previous custom category from a Taxonomy
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- Using heirarchial tags or Custom taxonomies
- Pagination does not work with query_posts()
- How to display products with multiple conditions, product_id and category_id
- Renaming default category taxonomy?
- Most efficient way to display current post subcategories?
- Dynamically creating content on custom URL without getting 404
- Display List of Categories Within a Custom Taxonomy
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- New Category – custom taxonomy
- How to add a post with new Taxonomy without assigning to default category?
- Query post only from categories that have subcategories
- Display 2nd category, only once, as sub-heading, in the loop
- List Terms by category
- Category and tags goes 404
- How to create default categories in new installs?
- Check if value is a custom taxonomy category name
- Displaying posts by year
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- Query pages by category
- Showing one post from each category, paged?
- query_posts problem – need help
- Taxonomy page wpml dropdown not working