1

I have a site where there are nearly 200 series (custom taxonomy) and roughly 10 items (posts) in each.

Each series is called 'Name: Series Number - One liner bout the series'.

When I use get_terms to get all series and order by name I get the order like this.

Name: 1 Name: 10 Name: 100 Name: 101 Name: 102 ... Name: 109 Name: 11 Name: 110

Any ideas on how to order this without having to add 001, 002 etc?

Alternatively when I order by ID it works perfectly since I added each series one by one after each other. The only issue is during that process I missed a series and only added it after having already added a few more series.

For example I was supposed to add series 121 but missed that and went on to add 122, 123,124 and then 121. Now when I order by ID I get 120, 122, 123, 124, 121, 125.

Tried manually changing the term_id in phpmyadmin without any luck.

0

https://pl.wordpress.org/plugins/taxonomy-terms-order/

This plugin does what you want, you can easily manage order.

0

How about ordering by count?

$categories = get_terms( 'category', array(
    'orderby'    => 'count',
) );

Reference: get_terms

  • Each series has a different amount of posts within them. Series 62 for example has 2 posts while series 50 has 24. Ordering by count would put series 62 before series 50. – DesignerEthan Jan 20 '16 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.