Nomang
Nomang

Reputation: 55

Wordpress: How to change the order of taxonomy lists using facetwp

I want to change the order of my list when display using facetWP. I have attached the image so that you could understand what i require.

enter image description here

Here is the query

$sql = "SELECT f.facet_value, f.facet_display_value, f.term_id, f.parent_id, f.depth, 0 AS counter FROM {$wpdb->prefix}facetwp_index f WHERE f.facet_name = '{$facet['name']}' AND post_id IN ($raw_post_ids) GROUP BY f.facet_value ORDER BY $orderby LIMIT $limit";

Thanks in advance.

Upvotes: 1

Views: 1909

Answers (1)

Matt
Matt

Reputation: 3896

Please see the last example on this page: https://facetwp.com/documentation/facetwp_facet_orderby/

Since this is a custom database table (not wp_posts), you will need to modify the SQL query itself, via the aforementioned filter.

Upvotes: 1

Related Questions