Change the portfolio category order in the Story gallery filter

WordPress by default doesn’t provide an order option for the categories. One way to set a custom order to your filter categories of the gallery page would be to order them by their slug. To do this you have to modify line 59 of the template-portfolio-gallery.php file:

$pexeto_gal->cat_args = array("hide_empty"=>false, "hierarchical"=>true);

to be like this:

$pexeto_gal->cat_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 default order. One option would be to append a number like this:

1-photography
2-landscapes
3-portraits

Was this useful? 4