Changing the gallery category order in Dandelion

WordPress by default doesn’t provide an order option to the categories. One way to set a custom order to your categories in the Portfolio Gallery page would be to order them by their slug. To do this, for the portfolio gallery you have to modify the template-portfolio-gallery.php file on line 57 and for the portfolio showcase you have to modify line 12 of the includes/portfolio/portfolio-setter.php file:

$args=array("hide_empty"=>false, "hierarchical"=>true);

to be like this:

$args=array("hide_empty"=>false, "hierarchical"=>true, 'orderby'=>'slug');

with this modification your categories will be ordered by slug, so by editing their slug you can change the order. One option would be to append a number like this:

1-photography
2-landscapes
3-portraits

Was this useful? 5