I'm trying to utilize the authors from wordpress to create a spotlight block in the sidebar that selects 1 random author from multiple users and only displays that 1 users information. I want to include the author's display name, a thumbnail, snippet of their bio and a link to the full author page. I haven't found any plugins that support this. I'm not a PHP/MySQL wiz so custom writing a function is a bit outside my abilities however I can read it and follow the code. What I have so far is:
<?php
global $wpdb;
$ids = $wpdb->get_results( "SELECT {$wpdb->usermeta}.user_id from {$wpdb->usermeta} where ({$wpdb->usermeta}.meta_key='wp_capabilities') and ({$wpdb->usermeta}.meta_value >0 )" );
$user_id = rand(1,count($ids));
$wpdb->show_errors();
?>
<h2><?php get_the_author_meta( 'display_name', $user_id ); ?></h2>
<img class="left" src="" alt="<?php print $selected_user; ?>" />
<p><?php get_the_author_meta( 'user_description', $user_id ); ?> <a href="<?php get_the_author_meta( 'user_url', $user_id ); ?>">read more</a>
This returns an array but I am unsure of what to do to get the output I need. Thanks in advance.