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
- Filter on one post type with taxonimy and get other post type
- Include custom post type that matches taxonomy field in another custom post type
- Showing all posts of the current custom taxonomy on archive page
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- get term id from term name
- Get Child Category only
- WP_Query to output chosen term and posts with no term assigned
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- How to print term name inside wp post loop
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- How to echo woocommerce category name
- 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
- Custom Taxonomy Breaks Pages
- Get posts by category name
- relation OR instead of AND – Filtered term ID’s in loop
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Query custom taxonomy for category including children
- Don’t repeat posts from children in parent taxonomy query
- Query Custom Post Type by Taxonomy
- Show multiple tax_query from 2 or more post_type in a single code
- Custom taxonomy in WP_Query not working
- How to display posts from custom post type category(custom Taxonomy) wise?
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- wp-query and wp_get_post_terms on custom taxonomy archive page
- Why is my pagination /page/2 taking me to index.php?
- Use get_cat_ID to retreive multiple category IDs
- Strange behaviour of hierarchical taxonomy archive
- Show X taxonomies of the latest published posts
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How can I order a post query’s results based on the number of matching taxonomy terms?
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Only show tag with the same id as the post
- display ACF repater field in archive page
- 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
- How to use the Term Object from a custom select field in a query
- 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?
- wp_query with meta_query and tax_query
- Related categories order posts by category
- WP_Query paginate with one term per page?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- WP Query for all events prior to current date
- How to get taxonomy image attached to a Post Type WordPress
- list all post who have mutual taxonomy as current taxonomy!
- WordPress search query, how to modify the sql
- Query WP Posts, then list the taxonomies from those posts
- How to break up output of posts for different terms on same page?
- Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?
- Custom Taxonomy – fields
- Displaying posts from sub taxonomies only
- Custom category page with taxonomy filters
- taxquery taxonomy get terms
- pages shortcode filtering by category
- Optimal way to make tags in tax_query optional?
- How to show terms from another taxonomy
- My entry results are not consistently alphabetized
- Adding additional taxonomies to wordpress taxonomy page
- I cannot get tax_query in get_posts() to work with custom taxonomy
- How to create page that lists tags by initial letter?
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Category Archive not working for pages
- How to combine nested tax_query logic with other nested query logic?
- Query Top Set Custom Taxonomy In Given Timeperiod
- Custom taxonomy and query multi conditions
- WP Query with sticky posts and tax_query