Hi, i’m using accordion with some search tags, but their order is always alphabetical. I want them to follow a specific order, how can i do that?
Thanks
Hey Qgrafica_7,
Thank you for the inquiry.
You can manually sort the tags using the avf_toggle_sorted_tags filter. For example, if you have three tags: a, b, and c, you can use the filter as follows:
add_filter('avf_toggle_sorted_tags', function ($tags, $atts) {
// default sorting
// $tags = array(
// 'a' => true,
// 'b' => true,
// 'c' => true,
// );
$reorderedTags = array(
'c' => true,
'b' => true,
'a' => true,
);
return $reorderedTags;
}, 10, 2);
Best regards,
Ismael
i added this css but it doesn’t work
add_filter(‘avf_toggle_sorted_tags’, function ($tags, $atts) {
$reorderedTags = array(
‘Home Staging’ => true,
‘Costi dell’Home Staging’ => true,
‘Tempi dell’Home Staging’ => true,
‘Agente Immobiliare’ => true,
‘Investitore Immobiliare’ => true,
‘Property Manager’ => true,
);
return $reorderedTags;
}, 10, 2);