Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1463812

    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

    #1463904

    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

    #1463964

    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);

    #1463995

    Hi,

    Thank you for the update.

    Where did you add the code? You have to add the filter in the functions.php file.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.