$args = array(
'tax_query' => array(
array(
'taxonomy' => 'typ',
'field' => 'slug',
'terms' => 'production',
),
),
'post_type' => 'opencourses',
'posts_per_page' => -1,
'post_status' => 'publish',
);
$query = new WP_Query( $args );
Please try above code.
Thanks.
Related Posts:
- Display all posts in a custom post type, grouped by a custom taxonomy
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Query for posts in 2 taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- wp_query to find posts by year and month
- Custom Post Type Loop within Shortcode
- Filter by custom taxonomy slug on a custom post type
- Custom loop with multiple taxonomy queries
- What’s the WP way to load remaining custom posts?
- display posts of custom post type with custom taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- What is the most efficient way to execute recursive complex queries?
- Loop with Custom Post Type and Taxonomies
- Post data in separate divs with incrementing class using WP_Query
- Catergory args causing loop not to show
- display custom post type from register taxonomy
- Complex Custom Loop with Includes
- Can I create a loop with multiple post types and specify different $args for each post type?
- shortcode to show custom post types by category
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- WP_Query orderby modified to include custom meta changes
- Am unable to reset a query properly
- Query/list all terms and their custom post count
- get_attached_media() on author page not working
- How to make sure content doesn’t display if selection is empty
- Filtering WP_Query Dynamically on the Front-End
- Show one item per category of a custom post type
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Get next and previous 3 posts in a term in single post page
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Loop custom taxonomy to get lists of cutom post types?
- 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-Posttype & Custom Taxonomy WP_Query
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom post type multiple loop by taxonomy term
- List custom taxonomy specific to one custom post type
- Show a Category X’s custom post type on Category X archive page?
- Display all taxonomy terms, add class if term applies to current post
- Return the latest post from a custom Taxonomy and Post Type
- Custom taxonomy rewrite give pagination 404
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Group CPT posts by custom taxonomy
- 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?
- Custom taxonomies relationship
- WP Query with categories only shows one post and ignores the category
- Display Custom Taxonomy Alphabetically
- Full Custom Post Type List Organised by two Taxonomies
- How to have this permalink structure: post_type/postname/custom_inner_page
- Problem: wp_query outputs all images on site
- Query Custom Post Type Taxonomy term with multiple parameters
- First custom field value (out of several) displayed twice after query
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_query
- Listing all term items alphabetically / sorting loop
- Advanced search form with filters for custom taxonomies
- Display related custom taxonomy posts in sidebar
- pagination not working for category.php (custom post types in categories)
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Custom Post Type Category Link
- Retrieve custom post types by custom taxonomies with WP_Query
- Custom Post type category pages template and loop
- Three Most Recent Posts, One Per Term
- get_the_title() is returning results from previous loop
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Wrapping x posts in html without leaving empty html
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- How to make WP_Query not to show irrelevant posts?
- How can I group posts by months and years?
- WordPress wp_query() basic question about args
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Main query not querying any posts in custom taxonomy template
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Create an archive page for custom post type with custom taxonomy
- Custom WP_Query doesn’t display all posts
- Using page slug in wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Query & the_content() is showing in the header
- Custom taxonomy wp_query woes.
- Variable not working in WP_Query