The term
parameter should actually be terms
, even when providing just one term:
$args = array( 'post_type' => 'course',
'tax_query' => array(
array(
'taxonomy' => 'course_codes',
'field' => 'slug',
'terms' => 'h001'
)),
'post_status' => 'publish'
);
Related Posts:
- The Operator “NOT IN” Does Not Work In tax_query
- Order posts by (hierarchical custom) taxonomy terms and term children
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Count number of posts which exist in 2 taxonomies?
- Query for custom post type objects in a taxonomy and with a meta value
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- How to Filter custom post type by taxonomy?
- How do I display the grand child items of a taxonomy term?
- How to display Related Posts based on number of taxonomy terms matched
- tax_query not working in template
- WP_query – Filter by tax_query and meta_query using multiple select
- WP_Query parameter conflict
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- tax_query (if the terms are empty)
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- custom post type and a “sticky” position taxonomy
- How to search through all child taxonomies using WP_Query?
- Custom search for a custom post type in WordPress
- How can I get the last 5 element of this tax query?
- tax_query not working?
- Getting Custom Posts with Custom Taxonomy
- WP Query tax_query not returning posts
- Error get_posts with Custom Taxonomy and OR relation
- How to show post which has the specific taxonomy terms?
- tax_query showing no results
- WP Query Conditionally query meta and taxonomy
- How to Add Custom Taxonomy To Woocommerce Plugin
- How to get the posts of a custom taxonomy term
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Create an archive page for custom taxonomies
- remove support for ‘Categories’ for a custom post type
- Categories under custom post types doesn’t show properly
- Hide child term posts on parent term pages
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- get a list of posts from Custom Taxonomy
- Want to filter only parent post in admin area
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Trying to manage templates on a blog with lots of custom taxonomies
- Display custom taxonomy as dropdown list
- Query to change custom post type with specific category
- Custom post type and taxonomy permalinks – Structure
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Custom Post Type and Custom Taxonomy Permalinks
- How many Custom Post Types to register?
- Insert HTML inside link in a walker
- Query custom post type by category slug
- How to bulk copy custom fields between custom posts?
- get_attached_media() on author page not working
- Search / Filter posts on Title/Content OR Tags
- Hide post navigation if current post is in a category with only one post
- Setting up taxonomy to relate various custom post types – advice on structuring?
- I want to change the word “Tags” in WordPress to something else, but how?
- What is the best practice for displaying my plugin content in themes?
- Set post terms for multiple posts
- Get terms that contain posts that in turn belong to other terms?
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Add filter to Admin list for all custom post types by their custom taxonomies
- Single.php for Custom Post Type > Taxonomy > Term
- Displaying custom taxonomy menu in custom post type archive
- Custom post types templates
- prevent sub categories to show up
- Custom post type category link redirecting to 404 page
- Custom post type and multi taxonomies + customize url
- Archive page URL for custom taxonomy and post type
- Custom Post Type Archive Page showing as 404
- Custom taxonomy terms hierarchical navigation
- Is it possible to add the Gutenberg block editor to a custom taxonomy?
- What is the best way to structure posts for the same event happening in different years?
- Dynamically Adding Posts of Post Type to A List
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- I cannot display custom posts in custom taxonomy
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- Custom taxonomy with custom post type template not showing
- Loop to display parent categories in custom taxonomy
- One-Time Script TimeOut for Large Data
- CPT Efficient way to display posts from different categories with custom query
- Associate custom categories to different user IDs
- How to create default taxonomy term for a custom post type? [duplicate]
- Extensive search filtering and results->PDF in the front-end
- archive-{custom_post_type}.php not getting recognized wordpress
- How to retrieve the permalink for a specific (custom) term?
- Values inside a custom field to determine which category posts to display
- Trying to create hierarchy between 3-4 custom post types
- title tag for custom post type remove taxonomy name from title tag
- Create a page selector using taxonomies
- Advanced search form with filters for custom taxonomies and custom fields
- Only One Post of Custom Post Type Appearing on Template Page
- Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
- register_term_meta not working
- Show custom category archive as front page and remove taxonomy slug from urls