$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:
- Get posts from sites in Multisite?
- Can’t custom taxonomies have same terms (slugs) as categories?
- get_categories for custom post type with a specific custom taxonomy attached
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Order get_terms() By Custom Field
- How can I add the featured image functionality to a custom taxonomy?
- 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?
- List posts by category exclude current post
- How to make custom taxonomy check boxes like ‘Categories’
- Different templates for parent and children categories/taxonomies
- cat_is_ancestor_of() for custom taxonomies
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- How to create non-unique sub-category slugs?
- Show Post from parent category (custom taxonomy) ONLY!
- How to convert regular categories to 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?
- How to load several hierarchical categories from functions.php
- wordpress taxonomy query posts
- 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
- how can i hide category?
- Posts not listing out sub category in hierarchy
- Post to inherit custom category background image from parent
- 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
- Exclude categories from postquery
- How to get posts using category slug in ClassiPress?
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Show posts from category specified using a custom field
- query_post problem
- Add class to current post in query_post
- 3.1 post formats and specific categories/custom taxonomies
- Link posts together (relative, not grouped)
- How to fix select filter on category
- Migrate the posts of a category to another blog as a custom taxonomy
- Different post slug based on archive
- List of post categories only associated to another custom taxonomy
- 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?
- Taxonomy custom check box meta field not getting saved
- Ordering terms whilst in loop
- When creating a new product, auto assign it to all custom taxonomy woocommerce
- Grab all the posts for particular category
- Get WooCommerce product category list in functions.php
- 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
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- Pagination does not work with query_posts()
- Assign a class to first element in category in loop
- How to display products with multiple conditions, product_id and category_id
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- Most efficient way to display current post subcategories?
- How to Manage and link certain custom taxonomy?
- 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
- How to add additional field to Add new category part (without plugin use) [closed]
- 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?
- Most efficient use of custom taxonomies, categories, and pages
- Create Cross Promoting Categories in WordPress Using ‘pre_get_posts’
- Check if value is a custom taxonomy category name
- Displaying posts by year
- Paginate WordPress Category Pages
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- How to have a category not show up in query post with page panigation?
- Query pages by category
- Showing one post from each category, paged?
- query_posts problem – need help
- How to Organize my Photo Albums?
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy page wpml dropdown not working
- How can I get the categories and subcategories separately?
- How can I filter Query Loop to show only posts in current category?
- get_term returns different results, sometimes empty, sometime the correct list