I have a WP_Query to display a custom post type:
<?php
//* The Query
$obras_query = new WP_Query( array (
'post_type' => 'obras_en_curso',
'posts_per_page' => 4
) );
//* The Loop
if ( $obras_query->have_posts() ) { ?>
<h3 class="title">Casas Unifamiliares - Obras en Curso</h3>
<ul> <?php
while ( $obras_query->have_posts() ): $obras_query->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li> <?php
endwhile; ?>
</ul> <?php
//* Restore original Post Data
wp_reset_postdata();
}
?>
Now I have created a taxonomy called "casa_unifamiliar".
This taxonomy is hierarchical, it has 2 types of "sub-taxonomies", one called "curso" and one called "finalizada". How can I Query a post with the sub-taxonomy "curso".