0

Im the admin of a website built in wordpress, builded by someone else. I know only the basics, I made a few changes here and there but now I hit a wall. What Im trying to do is order some categories by slug. Here is the code that calls categories.

     <?php foreach (get_categories('child_of='.get_query_var('cat')) as $cat): ?>

Im sure its not the best way to do it, another category page in the same website uses $args and there, it was pretty easy to solve the same problem. However I dont understand how this works. Hope someone can help me, in case you are curios the page this will reflect on is http://tumbili.mx/p/products/bsj/

Thanks a lot.

1 Answers1

0

you can use below code for ordering

foreach (get_categories('orderby=slug&order=ASC&child_of='.get_query_var('cat')) as $cat):

Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104