The loop does not show users

You need to add this code to the file functions.php. function custom_post_author_archive($query) { if ($query->is_author) $query->set( ‘post_type’, array(‘post-type’, ‘post’) ); remove_action( ‘pre_get_posts’, ‘custom_post_author_archive’ ); } add_action(‘pre_get_posts’, ‘custom_post_author_archive’);

how to add around each author using wp_list_authors

If you require customized solution then you can use user query like this. <?php $args = array( ‘who’ => ‘authors’, ‘orderby’ => ‘display_name’ ); $wp_user_query = new WP_User_Query($args); if ( ! empty( $wp_user_query->results ) ) { foreach ( $wp_user_query->results as $user ) { echo ‘<span class=”abc”><a href=”‘ . get_author_posts_url( $user->ID ) . ‘”>’ . $user->display_name … Read more

Filter authors on meta value

Is there a specific reason you aren’t using WP_User_Query? It would make it easier to do what you want to. You can read up on it here. Something along these lines would solve your problem, as far as I understand it: $args = array( “meta_key” => “ArtistCategory”, “meta_value” => “X” //or “Z” ); $authors = … Read more

I’m trying to create a custom version of the wp_list_authors function that includes custom post types

Ok, so I found the solution to this problem and I thought I’d post it here for anyone else who may stumble upon this question. Turns out I was making this much more difficult than it needed to be. I just added a simple function to the custom site plugin I created (this could also … Read more

wrap a span tag around author’s post count

It doesn’t appear that wp_list_authors() supplies an appropriate hook to modify anything unfortunately. The next best thing would be to just do a string replace and hope for the best :/ $start_wrapper=”<span class=”author-post-count”>”; // Set our wrapper start tag $end_wrapper=”</span>”; // Set our wrapper end tag $author_html = wp_list_authors( array( // Get Author HTML ‘optioncount’ … Read more

Filter to wp_list_authors

wp_list_authors(), displays a list of the sites’s authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts. Use $authors = get_users( [ ‘role__in’ => [ ‘auther’] ], // add other parameters ); Then loop through $authors to create your own list. foreach ( $authors … Read more

Order users by user role

@CynthiaLara I suppose that you are using a container of WP_USER_QUERY::__construct in the form or WP_USER_QUERY or get_users or something to that effect. You can use ‘meta_key’ => ‘<YOUR_DESIGNATION_META_KEY>’,’orderby’ => ‘meta_value_num, to get results sorted by your meta key’s value. If you have used a texted based value in for this meta_key, please consider using … Read more

Combining wp_list_authors with get_user_meta

What you want is not supported by wp_list_authors(). To output them the way you want you will need to use get_users() and display them yourself. $authors = get_users( array( ‘orderby’ => ‘display_name’, ‘order’ => ‘ASC’ ) ); foreach ( $authors as $author ) { echo esc_html( $author->last_name . ‘ ‘ . $author->first_name ); } You … Read more