Looking to use orderby to order multiple WP Query columns? All you may need is to feed the orderby argument an array with different columns.
1 answers
1
Order by multiple columns in WP Query
To order by multiple columns in WP Query, you must use an array inside your loop’s orderby argument.
$args = array( post_type => 'post', orderby => array( 'date' => 'ASC', 'titlle' => 'DESC' ) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); //the loop's content endwhile;
— Support WizardAnswer 1