Order Child Galleries Differently
You may want to order your parent galleries differently than your child galleries. For example, on your main Client Galleries page you may want to order all galleries by their dates. Then, for your child galleries order them alphabetically.
This code snippet does exactly this but can be adjusted to change the ordering method for child galleries (any gallery that has a parent) in any way you wish.
add_filter( 'sunshine_get_galleries_args', 'sunshine_get_galleries_args_filter' );
function sunshine_get_galleries_args_filter( $args ) {
if ( ! empty( $args['post_parent'] ) ) {
$args['orderby'] = 'title';
$args['order'] = 'ASC';
}
return $args;
}
Learn how to add this custom code to your WordPress website
Still need help?
If you have not yet found your answer in the documentation articles, please contact support