You can order by count
to order them by the number of posts they are attached to. Use number
to limit the number of terms returned:
wp_list_categories( [
'orderby' => 'count',
'order' => 'DESC',
'number' => 5
] );
You can order by count
to order them by the number of posts they are attached to. Use number
to limit the number of terms returned:
wp_list_categories( [
'orderby' => 'count',
'order' => 'DESC',
'number' => 5
] );