Voeg deze code toe aan functions.php van je thema of in Code Snippets.


// change facetwp sort by options
add_filter( 'facetwp_sort_options', function( $options, $params ) 
{    unset( $options['date_asc'] );    unset( $options['title_asc'] );    unset( $options['title_desc'] );    unset( $options['date_desc'] );    
$options['default']['label'] = 'Populariteit';
    $options['price_asc'] = [        'label' => 'Prijs laag - hoog',        'query_args' => [            'orderby' => 'meta_value_num',            'meta_key' => '_price',            'order' => 'ASC',        ]    ];    
$options['price_desc'] = [        'label' => 'Prijs hoog - laag',        'query_args' => [            'orderby' => 'meta_value_num',            'meta_key' => '_price',            'order' => 'DESC',        ]    ];        
$options['popularity_new'] = [        'label' => 'Populariteit',        'query_args' => [            'orderby' => 'post_views',            'order' => 'DESC',        ]    ];
        return $options;    }, 10, 2 );