Sorting code for categories in Elementor through Wordpress

Viewed 43

when I try to add some theme-specific categories grid on Elementor through Wordpress, it adds them randomly in the list, giving it a rather disorganised and difficult-to-understand appearance regardless whether I try to add it in alphabetical order.

I have tried some plugins but they have no affect. Finally I found this bit of code.

What additional code could I add to this code below so that it adds the categories in alphabetical order?

$this->add_control(
                'place_list', [
            'label' => __('Type the category name you want to show', 'rentals-elementor'),
            'label_block' => true,
            'type' => \Elementor\Controls_Manager::SELECT2,
            'multiple' => true,
            'options' => $all_tax_elemetor,
                ]
        );
0 Answers
Related