Snippets: Order Related Staff by Name

// Alter the related staff posts query
function myprefix_custom_related_staff_args( $args ) {
    // Change order from random to name
    $args['orderby'] = 'title';
    // Return args
    return $args;
}
add_filter( 'wpex_related_staff_args', 'myprefix_custom_related_staff_args' );

Snippet Type: PHP

Posted Under: Staff

All PHP snippets should be added via a child theme's functions.php file.