vendredi 27 février 2015

Custom Order for Categories in Wordpress

I would like to use the get_categories() function in wordpress to display categories in a specific custom order. There seems to be no easy way to do this.


This is my current code:



$cat_order = array(26,31,30,35,34,37,36,33,38,28,32,29,27);
$category_args = array(
'order' => 'ASC',
'include' => $cat_order,
);
$categories = get_categories( $category_args );


For some reason I cannot order them by the specified order in the array. Is this even possible? It is possible for posts.


Aucun commentaire:

Enregistrer un commentaire