Title: Random authors
Last modified: August 20, 2016

---

# Random authors

 *  [alex27](https://wordpress.org/support/users/alex27/)
 * (@alex27)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/random-authors/)
 * Would it be possible to modify the widget, so that it displays random authors?
   For example I don’t want to display all my blog authors, only 2 or 3, but I want
   them to be randomly chosen so that I don’t end up with the same 3 authors on 
   every page! I’m good with php, so I should be able to code it myself, but I’d
   appreciate any pointers.
 * [http://wordpress.org/extend/plugins/display-authors-widget/](http://wordpress.org/extend/plugins/display-authors-widget/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Sami Keijonen](https://wordpress.org/support/users/samikeijonen/)
 * (@samikeijonen)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/random-authors/#post-3258827)
 * This plugin uses `get_users` function and it doesn’t have random order. You can
   check the orderby values here.
 * [http://codex.wordpress.org/Function_Reference/get_users](http://codex.wordpress.org/Function_Reference/get_users)
 * You can filter query like this in your custom plugin or child theme functions.
   php.
 *     ```
       add_filter( 'display_authors_widget_query', 'my_order_by_post_count' );
   
       function my_order_by_post_count( $query_args ) {
   
       	$query_args['order_by'] = 'post_count';
   
       	return $query_args;
   
       }
       ```
   
 * Maybe you could play with offset value like this.
 *     ```
       add_filter( 'display_authors_widget_query', 'my_order_by_post_count' );
   
       function my_order_by_post_count( $query_args ) {
   
       $my_random = rand(0, 10);
   
       $query_args['offset'] = $my_random;
   
       return $query_args;
       }
       ```
   
 *  Thread Starter [alex27](https://wordpress.org/support/users/alex27/)
 * (@alex27)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/random-authors/#post-3258838)
 * Thank for your reply. I ended up using your plugin as a base and making many 
   more customizations. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Random authors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/display-authors-widget_edeef4.svg)
 * [Display Authors Widget](https://wordpress.org/plugins/display-authors-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/display-authors-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/display-authors-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/display-authors-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-authors-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-authors-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [alex27](https://wordpress.org/support/users/alex27/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/random-authors/#post-3258838)
 * Status: not resolved