How to change the order of authors in the Authors List page
Jannah uses the standard WordPress get_users function which sorts the authors alphabetically by the user login name, the function supports the following fields to sort the authors
- ID
- display_name
- user_login
- user_nicename
- user_email
- user_url
- user_registered
- post_count
For example to sort the authors in the Authors List page by the number of posts they published. add this code to your child theme’s functions.php
file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php
file, as this will be wiped entirely when you update the theme.
add_filter( 'TieLabs/Page_Template/Authors/args', 'custom_chnage_authors_order' ); function custom_chnage_authors_order( $args ){ $args['orderby'] = 'post_count'; $args['order'] = 'DESC'; return $args; }