WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] List some authors (2 posts)

  1. ZoiX
    Member
    Posted 2 years ago #

    Hi there,

    In a theme I'm building I need to list some authors (not all), but in de codex I'm reading that I can only exclude the admin. In the theme, the profile of each author is "Author", so, if I list the authors of "Authors" profile (I don't know how do that), I will get the same issue.

    I was imagining something like wp_list_authors('exclude=4,5,7"); but it's not possible, as you know, and I guess there is some way to do that.

    I readed about a plugin called List Authors Plus WordPress Plugin that allow us to exclude some authors using their ID, but now it doesn't exist in the plugins database.

    By the way, I need to list them and add a link to http://www.thesite.com/author/username to :/

    Thank you all.

  2. ZoiX
    Member
    Posted 2 years ago #

    Newbie question, I'm sorry, I was seeking throught user info and I get this:

    <?php $users_i_need = get_users('role=author&exclude=1, 2,3,4,46');
        foreach ($users_i_need as $user) {
        echo '<li>' . $user->display_name . '</li>';
    } ?>

    With get_users I can get URL too:

    <?php $users_i_need = get_users('role=author&exclude=1,2,3,4,46');
         foreach ($users_i_need as $user) { ?>
              <ul>
                   <li><a>/author/<?php echo $user->user_login ?>"</a><?php echo $user->display_name ?></li>
              </ul>
         <?php }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic