X
X
xGreen_Max2022-04-14 16:22:59
WordPress
xGreen_Max, 2022-04-14 16:22:59

How to sort tags alphabetically (WordPress)?

I am adding a new label "Yakak"
through the WordPress admin panel, it should be at the very end, since the letter I is the last in the alphabet.
But I have the label "Yakak" displayed on the page at the very beginning of the list in the tag cloud.

Here is a screenshot:
6258426621908370434623.png

How to sort label cloud alphabetically in WordPress.

My code for displaying labels:

<article class="Tags_Main_Block"> 
 <p class="tag-titles">МЕТКИ:</p>
 <div class="opase">

 <?php 
 wp_tag_cloud( [
    'smallest'  => 14,
    'largest'   => 14,
    'unit'      => 'pt',
    'number'    => 0,
    'format'    => 'flat',
    'separator' => "",
    'orderby'   => 'name',
    'order'     => 'ASC',
    'exclude'   => null,
    'include'   => null,
    'link'      => 'view',
    'taxonomy'  => 'post_tag',
    'echo'      => true,
    'topic_count_text_callback' => 'default_topic_count_text',  
] );
?>

</div>
 </article>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Gvozdev, 2022-04-14
@arty23_03

instead of 'order' => 'ASC', you need 'order' => 'DESC',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question