I am having the same issue getting mine to sort properly… Below is the code i’m trying to use. Have I missed something in the syntax, please let me know. Thanks!
<?php
if ( count( $filters ) == 1 && in_array( 'All Categories', $filters ) ) {
$args = array(
'post_type' => 'x-portfolio',
'posts_per_page' => $count,
'paged' => $paged,
'orderby' => 'title',
'order' => 'ASC'
);
} else {
$args = array(
'post_type' => 'x-portfolio',
'posts_per_page' => $count,
'paged' => $paged,
'tax_query' => array(
array(
'taxonomy' => 'portfolio-category',
'field' => 'term_id',
'terms' => $filters,
'orderby' => 'title',
'order' => 'ASC'
)
)
);
}
$wp_query = new WP_Query( $args );
?>
I have also added the _portfolio.php file to my child theme under the themes/x-child-integrity-light/framework/views/global/ folder and the main x theme and neither seem to change the sort order of the portfolio items. Thank you in advance!