Pergunta

I currently have these 2 loops running on a single page

$related = p2p_type( 'artist_to_song' )->my_get_related( get_queried_object() );
$features = p2p_type( 'song_to_feature' )->my_get_related( get_queried_object() );


if ( $related->have_posts() ) : 
   while ( $related->have_posts() ) : $related->the_post();
      //content
   endwhile;
   wp_reset_postdata();                             
endif;

if ( $features->have_posts() ) : 
   while ( $features->have_posts() ) : $features->the_post();
      //content
   endwhile;
   wp_reset_postdata();                             
endif;

Is it possible to combine the results of these loops into one so that all the posts are listed in chronological order as opposed to the results of $related being followed by $features.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange
scroll top