<?php
// Add to your (child) theme's functions.php
add_action( 'pre_get_posts', function( $query ) {
if ( $query->is_post_type_archive( 'resource' ) ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
});
Code snippets for FacetWP
<?php
// Add to your (child) theme's functions.php
add_action( 'pre_get_posts', function( $query ) {
if ( $query->is_post_type_archive( 'resource' ) ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
});