WordPress Snippets at WPcustoms

List your authors

show your website’s authors and a link to their post archives. Cool feature if your site is a multi-author blog.


/**
 * Snippet Name: List your authors
 * Snippet URL: https://wpcustoms.net/snippets/list-authors/
 */
  // usage: echo wpc_list_authors();

function wpc_list_authors() {
    $authors = get_users(array(
            'orderby' => 'display_name',
            'count_totals' => false,
            'who' => 'authors' // change to different userrole if required
        )
    );

    $list = '';
    if($authors) :
        $list .= '';
    endif;
    return $list;
}