How to sort a list/query of authors
-
I’ve made a listing of all listed users and i’ve excluded the admin user.
I’ld like to list only authors and contributors and sort it by name, instead of by ID.
Example is shown on https://www.documentingstyle.com/contributors/?theme=Code
foreach ( get_users_of_blog() as $author ) : if ($author->ID != '1' ) { ?> <div id="hcard-<?php echo str_replace( ' ', '-', get_the_author_meta( 'user_nicename', $author->ID ) ); ?>" class="author-profile vcard clear"> <h2 class="author-name fn n"> <a href="<?php echo get_author_posts_url( $author->ID ); ?>" title="<?php the_author_meta( 'display_name', $author->ID ); ?>"><?php the_author_meta( 'display_name', $author->ID ); ?></a> </h2> <a href="<?php echo get_author_posts_url( $author->ID ); ?>" title="<?php the_author_meta( 'display_name', $author->ID ); ?>"><?php echo get_avatar($author->ID); ?></a> <p class="author-bio"> <?php the_author_meta( 'description', $author->ID ); ?> </p><!-- .author-bio --> </div><!-- .author-profile .vcard --> <?php } endforeach;
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to sort a list/query of authors’ is closed to new replies.