You can create a taxonomy query. Assuming that “curso” is the term slug, it would look like this:
$query = new WP_Query( array(
'post_type' => 'obras_en_curso',
'posts_per_page' => 4,
'tax_query' => array(
array(
'taxonomy' => 'casa_unifamiliar',
'field' => 'slug',
'terms' => 'curso',
),
),
) );
For more information, see: https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Related Posts:
- Display posts the match taxonomy term linked from wp_list_categoies?
- Filter and list posts of a custom taxonomy
- How to Modify Taxonomy Archive Page with Search Parameter?
- Display link to taxonomy archive only if it has posts with certain custom field values
- Order taxonomy terms in alphabetical order
- Function get_queried_object() return NULL in custom taxonomy
- Getting Taxonomy inside WP_Query Loop
- How do I exclude the lowest level terms in a taxonomy?
- Post loop for all taxonomy terms
- wp_query args adding muitiple tax_querys
- Custom taxonomy.php not working
- Using custom taxonomies in a query
- How to add custom meta to ‘pre_get_terms’?
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- How to get posts by category and by choosing a taxonomy term?
- get_the_terms has strange result since version 6.0
- WordPress – Form does not filter the results of taxonomies
- Show one post of each custom taxonomy
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- How to define a custom hierarchy for terms?
- Taxonomy Terms That Don’t Exist Display Results
- How can I get all the posts that are related with a specific taxonomy term?
- tax_query not working properly with get_posts
- Using wp_query is it possible to orderby taxonomy?
- WP query taxonomy input differs to output?
- How to add taxonomy filter on the query fly?
- Combine two taxonomies in a hierarchical tree
- Why is my WP_Query not working when tax_query terms are an array?
- Select posts wich has no relationship in custom taxonomy
- Move posts to top of WP_Query if in certain Taxonomy?
- How to get the parent’s taxonomy?
- Querying Multiple Custom Taxonomy Terms
- Adding session variable and/or cookie based on user-selected input
- WP Query – Get WooCommerce Products with variation that is in stock
- Filter WordPress posts by between parameter
- Get array of current post term ID’s
- How to add terms to my tax_query based off of the current post
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- WP Query for variable taxonomies
- Fetch taxonomies by custom post type id array
- Order posts by taxonomy count
- Complex WP_Query (two post types and multiple operators)
- Remove category from query (show all posts in archive.php) pre_get_posts()
- is_tax() function not working as expected
- Display Featured Post by Categories and Avoid duplicated posts
- Get authors by term id or slug
- WP_Query tax query part of slug
- How to Union two different conditions in one WP_Query
- WP_Query ignoring tax_query when is_singular
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- How to display an other custom post type in a different custom post type’s archive?
- find posts that don’t have a custom taxonomy
- Taxonomy order exception for specific term
- Filter Custom Taxonomy Posts
- Get posts from multiple tax terms
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- WP_Query to output chosen term and posts with no term assigned
- Loop posts based on permalink term
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Check if a post has term inside loop
- WP Query – filtering terms with regex
- How to restrict search on a certain page to only return results against custom taxonomies?
- Query Taxonomy By Page Title
- Get posts by category name
- relation OR instead of AND – Filtered term ID’s in loop
- Query custom taxonomy for category including children
- Don’t repeat posts from children in parent taxonomy query
- Show multiple tax_query from 2 or more post_type in a single code
- How to display posts from custom post type category(custom Taxonomy) wise?
- Strange behaviour of hierarchical taxonomy archive
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- tax_query not working on custom post type
- Filter for each loop when WP_Query has no posts to show
- Save queried result into database
- Custom Taxonomy – Modify Function to Get Child Category
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- WooCommerce WP_Query using tax_query returns no results (0 = 1)
- How do I stop the same post showing multiple times in a archive?
- Related categories order posts by category
- How to get taxonomy image attached to a Post Type WordPress
- How to break up output of posts for different terms on same page?
- Custom Taxonomy – fields
- Custom category page with taxonomy filters
- taxquery taxonomy get terms
- Adding additional taxonomies to wordpress taxonomy page
- Query Top Set Custom Taxonomy In Given Timeperiod
- Custom taxonomy and query multi conditions
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- Get newest value of an array
- Filter custom post type by custom taxomony
- Multiple loops on a Search result page?
- Using wp_query is it possible to orderby taxonomy?
- query_posts problem – need help
- Multiple Orderby is not working right
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Three different queries on same page
- Display Featured image from custom post type category (custom taxonomy) wise