5
I used that code:
<ul>
<?php
$args = array(
'post_type' => 'integrante',
'orderby' => 'title',
'order' => 'asc',
'lang' => 'pt',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'integrante_category',
'field' => 'slug',
'terms' => array( 'equipe_fundador','equipe_financas' )
),
),
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) : $query->the_post();
?>
<li>
<h3 class="nome"><?php the_title(); ?></h3>
</li>
<?php endwhile; wp_reset_query();?>
</ul>
It returns all the posts of the two taxonomies I put in. However, I need it to include a division (title) between one taxonomy and another, thus would have the mark of where begins the loop of each one.
pq not make two separate loops?
– Caio Felipe Pereira
I ended up doing this. But my question was whether there was another way. In this case, I have 10 categories, so I did 10 loops.
– Aline de Souza
you can try to sort the Wp_query results in some way... a flag inside the loop might solve, the question is sorting. I’ll give a thought here
– Caio Felipe Pereira