Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FacetWP - order by display value numerically
<?php
// Add the following to your (child) theme's functions.php
add_filter( 'facetwp_facet_orderby', function( $orderby, $facet ) {
if ( 'size_women' == $facet['name'] ) {
$orderby = 'f.facet_display_value+0 ASC';
}
return $orderby;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.