kanabi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Author list with avatars – how to exclude lower rank users?Brilliant, it’s working! Thank you so much:)
Forum: Fixing WordPress
In reply to: Author list with avatars – how to exclude lower rank users?Still no error, but the list disappeared completely…
Forum: Fixing WordPress
In reply to: Author list with avatars – how to exclude lower rank users?Ok, so now I’ ve got this:
function contributors() { global $wpdb; $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' ORDER BY display_name"); foreach($authors as $author) { $user = new WP_User( $author->ID ); if ( !empty( $author->roles ) && is_array( $author->roles ) ) { foreach ( $author->roles as $role ) echo $role; } echo ""; echo '<div class="authWrap">'; echo '<div class="authPic">'; echo "<a href=\"".get_bloginfo('url')."/?author="; echo $author->ID; echo "\">"; echo get_avatar($author->ID,$size = '50'); echo "</a>"; echo "</div>"; echo '<div class="authName">'; echo "<a href=\"".get_bloginfo('url')."/?author="; echo $author->ID; echo "\">"; the_author_meta('display_name', $author->ID); echo "</a>"; echo "</div>"; echo "</div>"; echo ""; } }The script returns no error so far, but still I have no idea how to make it display roles above subscriber only…
Forum: Fixing WordPress
In reply to: Author list with avatars – how to exclude lower rank users?I’m using standard WP user roles and settings (WP v. 3.4.1), I guess.