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)
- Display all posts in a custom post type, grouped by a custom taxonomy
- What are the differences between custom post type and custom page templates?
- 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
- Ordering Posts List By Taxonomy Terms?
- The Operator “NOT IN” Does Not Work In tax_query
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- Custom query – alternate posts by category
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- How to get_queried_object on multiple objects?
- how to group custom post type posts by custom taxonomy terms
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Querying Posts by Taxonomy From Alternate Network Site
- Sort the main query in subcategories/terms?
- Help with hierarchical custom taxonomies and permalinks…almost there
- Custom Taxonomy List links being re-written
- custom post type paging not working past page 3
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Want to filter only parent post in admin area
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Custom Taxonomy and tax_query Issue?
- Query for posts in 2 taxonomies
- Exclude current post when getting related post on custom post type and taxonomy
- Ordering Custom Post Types with WP_Query
- Paginated Taxonomy Term Archive including one post per term
- 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
- Multiple portfolios with one custom post type?
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- WP_Query search posts by custom post type and custom taxonomy
- Help with CPT template pagination
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- Querying Term Posts in Loop
- Custom Post Type Loop within Shortcode
- 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
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Display CPT posts based on specific taxonomy
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- 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
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Custom taxonomies relationship
- How to have this permalink structure: post_type/postname/custom_inner_page
- How to display elements of different post types?
- Storing/querying custom date data
- Display Custom Taxonomy of custom post type
- WP Query Post Type with same Taxonomy name
- WP Query WordPress Post Type with the same Taxonomy name
- 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
- Catergory args causing loop not to show
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- display custom post type from register taxonomy
- 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
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Query custom post type and group by taxonomy
- WP Query – Can’t get posts with specific taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy
- WP_Query not using relation key as expected and not producing any results
- WP Query filtering by custom category not showing all relevant posts
- How to assign a single-menu-template to a menu-items in a taxony/ cat/ subcat/ subcat-item
- Custom fields disappearing when a custom post type is assigned
- wp_insert_term how to insert “” in description