FacetWP – ignore depth when sorting by display value

mgibbs189

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

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

add_filter( ‘facetwp_facet_orderby’, function( $orderby, $facet ) {
if ( ‘pa_variety’ == $facet[‘name’] ) {
$orderby = ‘f.facet_display_value ASC’;
}
return $orderby;
}, 10, 2 );

{{/gist}}