WordPress.org

Ready to get started?Download WordPress

Forums

List Authors in Sidebar (2 posts)

  1. Maxaud
    Member
    Posted 5 years ago #

    I'm posting this here becuase I wasn't able to post on the WordPress MU forums and kept getting an error.

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

    <h2>Link list of authors:</h2>
    <ul>
        <?php
        $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>
        <?php
        endforeach; // end of authors' profile 'loop'
        ?>
    </ul>

    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 myfhablog.com 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. Maxaud
    Member
    Posted 5 years ago #

    was able to post this on the MU forums here:
    http://mu.wordpress.org/forums/topic.php?id=10186

Topic Closed

This topic has been closed to new replies.

About this Topic