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
- Add term to custom post type on draft
- Multiple tag cloud filtering
- List of Posts and Categories
- Grouping of CPTs and taxonomies into menu groups in admin
- Best way to organize book-page structure
- Get url.com/post_type/taxonomy/term work!
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Invalid argument supplied in register_taxonomy $args->taxonomies
- set permalink for CPT
- Top Level pages in wordpress giving 404, but child pages working fine
- Sitemap generation
- Plugin fatal error
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy/Custom post type structure suggestion on a movie site
- Search by tag name and category
- Taxonomy in URL
- Ordering values entered in Custom Taxonomies
- Listing all term items alphabetically / sorting loop
- How to produce a sub-page-system in WordPress
- Change the Custom Taxonomy URL Slug pattern
- Advanced search form with filters for custom taxonomies
- Custom taxonomy and post type with same slug
- Losing Nav Active State in Menu
- WordPress custom taxonomy template not working
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- Listing custom terms in custom post meta
- Show fields based on taxonomy selection in editor
- Display related custom taxonomy posts in sidebar
- WordPress subpages to custom post types
- Different rewrite rules for taxonomies and cp in multisite?
- Permalinks: custom structure for taxonomy – tags?
- count results in search page based on custom category
- Custom permalink with child taxonomy terms
- Assign Custom post to Custom Taxonomy
- Custom post type Permalinks with hierarchical Taxonomies
- Display Registered Taxonomies
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- Show custom post type inside a custom post type
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Display and register custom categories for custom post types
- Why is my WP_Query outputting my entries twice?
- Different Category system needed for the Custom Post Type
- Not Able To Render Single-CustomPostType.php File
- Custom Post Type Category Link
- Retrieve custom post types by custom taxonomies with WP_Query
- Custom Post type category pages template and loop
- Archive for a Taxonomy of a Custom Post type
- Three Most Recent Posts, One Per Term
- Check if post has specific tag_ID in custom post type
- How to get WordPress term attached to the Post?
- Query posts with double taxonomy
- Custom Post Archive is not working
- Custom post type pagination 404
- get_the_title() is returning results from previous loop
- Why cant I add a custom post type to a custom taxonomy?
- Show Custom Taxonomy title in loop
- WP the_posts() on single-cars.php get category link
- Trick to get custom post types to show up on a custom taxonomy page?
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- How to add custom taxonomy in custom post type permalink?
- single-{post_type}.php not working
- Properly flush rewrite rules on plugin activation
- Adding predefined terms to a taxonomy
- How to solve this custom post type goes to 404 page?
- Get term name without a foreach loop
- Show all tags on custom post type
- Template to list categories in custom taxonomy
- How to Set Taxonomy Object Description?
- Best way to specify “article type” in URL
- How do I add a Custom Post Type that looks and behaves exactly the same as Posts?
- custom post type vs. conditionally displaying meta boxes for specific terms?