Support » Plugins and Hacks » List Authors in Sidebar
8 years, 4 months 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>
$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 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.
was able to post this on the MU forums here: