FacetWP – sort by menu_order for certain post type

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add to your (child) theme’s functions.php

add_action( ‘pre_get_posts’, function( $query ) {
if ( ‘providers’ == $query->get( ‘post_type’ ) ) {
$query->set( ‘orderby’, [ ‘menu_order’ => ‘ASC’, ‘date’ => ‘DESC’ ] );
}
});

{{/gist}}