The MU forums have moved to

List Authors in Sidebar (2 posts)

  1. maxaud
    Posted 15 years ago #

    I'm using this code in my sidebar on a regular wordpress to list authors:

    <h2>Link list of authors:</h2>
        $order = 'user_nicename';
        $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users ORDER BY $order"); // query users
        foreach($user_ids as $user_id) : // start authors' profile "loop"
        $user = get_userdata($user_id);
        <li><?php echo '<a href="' . $user->user_url . '">' . $user->display_name . '</a>'; ?><br /></li>
        endforeach; // end of authors' profile 'loop'

    but on a WordPress MU theme it lists all blogs users..

    How do I restrict it to use the current blogs authors/contributors?

    An example of what I'm trying to do can be seen at where we've got a list of authors with gravatars that are randomized.

    Thanks in advance to those that help me shed some light on my poor php/sql skills.

  2. dsader
    Posted 15 years ago #

About this Topic