The taxonomy, field and terms in tax_query should be two array-level deep instead of one. Quoted from the WP_Query page:
Important Note: tax_query takes an array of tax query arguments arrays
(it takes an array of arrays) – you can see this in the second example
below. This construct allows you to query multiple taxonomies by using
the relation parameter in the first (outer) array to describe the
boolean relationship between the taxonomy queries.
So, your arguments shoud be like:
$args = array(
'post_type' => 'contents',
'tax_query' => array(
array(
'taxonomy' => 'content-category',
'field' => 'id',
'terms' => array(5,26,28)
)
),
'meta_key' => 'fs16'
);
You may omit 'post_status' => 'publish' since it’s the default value used anyway.
Related Posts:
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Exclude a category from WP_Query
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- query multiple taxonomies
- Custom Taxonomy with Custom Post Type Finds No Posts
- Custom query – alternate posts by category
- How to get_queried_object on multiple objects?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- Want to filter only parent post in admin area
- Custom Taxonomy and tax_query Issue?
- Custom post query by taxonomy
- Querying CPT with Two Taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom Query to display posts with custom field
- Get taxonomy description based on variable
- Show Post Count of a Category
- Help with CPT template pagination
- Fetch taxonomies by custom post type id array
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Filter by custom taxonomy slug on a custom post type
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Query/list all terms and their custom post count
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Search / Filter posts on Title/Content OR Tags
- Custom loop with multiple taxonomy queries
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- How to have this permalink structure: post_type/postname/custom_inner_page
- First custom field value (out of several) displayed twice after query
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Retrieve custom post types by custom taxonomies with WP_Query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Using page slug in wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Custom taxonomy wp_query woes.
- Creating two loops based on different logic
- WP_Query parameter conflict
- Different options per post type in WP_Query
- How to show all taxonomies within custom post type loop
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- How to query Posts from a custom post type which contains a custom taxonomy?
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Enabling permalinks disables custom page template
- Foreach loop returning more than one item when querying taxonomy
- Loop and add Specific Categories and Products Images
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- Sorting the Loop by Taxonomy Value
- custom taxonomy pagination 404 error
- Ordering by meta value not working
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- WP_Query to display number of custom post type filtered (order by) taxonomy
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Live search by custom tag
- Query a custom taxonomy in a function to create an csv file
- WP_Query based on ‘s’ and tax_queries
- Ajax load more inside custom post type taxonomy
- Create a custom wp_query from a specific custom post type with specific taxonomy
- The most recent post of custom taxonomy
- Problems with the WP_Query query for a Custom post type
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Display all Custom taxonomy terms and their relevant custom posts
- Query pulling all taxonomies, not one I am specifying
- Ordering Posts List By Taxonomy Terms?
- CPT Efficient way to display posts from different categories with custom query
- Query Pulling the same post twice
- Get posts associated with custom taxonomy alternate way
- Loop with Custom Post Type and Taxonomies
- tax_query showing no results
- Post data in separate divs with incrementing class using WP_Query
- Values inside a custom field to determine which category posts to display
- How to display elements of different post types?
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- Listing all custom post types using a specific term on the said term’s template page, in groups
- get tags from custom post type
- Attaching multiple custom taxonomies to one CPT?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- WP Query Conditionally query meta and taxonomy
- WP Query – Can’t get posts with specific taxonomy
- WP_Query not using relation key as expected and not producing any results
- Custom fields disappearing when a custom post type is assigned