WordPress.org

Ready to get started?Download WordPress

Forums

Author List Shows All Users. How Do I Show Just Authors? (4 posts)

  1. BUFFETTNH
    Member
    Posted 1 year ago #

    I have subscribers, contributors, and authors on my site.
    I have an author page, but by default it is showing all registered users to my site. I only want to show my authors.

    How do I tell WP to only publish certain users on the author page?

    Thanks!
    Jason

  2. bythegram
    Member
    Posted 1 year ago #

    What code are you using on your "Author Page"? (use pastebin for large amounts of code).

    Do you have a link to the page in action?

  3. BUFFETTNH
    Member
    Posted 1 year ago #

    Here is the page, but I am manually making this page

    http://paintballtech.net/paintballtech-net-authors-contributors/

    I see the option for me to use the Author List as a template on this page, which looks great. It just lists everyone!

  4. bythegram
    Member
    Posted 1 year ago #

    You should be able to use: http://codex.wordpress.org/Function_Reference/get_users

    It allows you to filter by role, just an example:

    <ul>
    <?php
        $blogusers = get_users('orderby=nicename&role=author');
        foreach ($blogusers as $user) {
         $avatar = get_avatar( $user->ID, 32 );
            echo '<li>' . $avatar . $user->display_name . '</li>';
        }
    ?>
    </ul>

    The above code is untested but should get the ball rolling.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags