Title: paginate author boxes
Last modified: August 31, 2016

---

# paginate author boxes

 *  [mdgarts](https://wordpress.org/support/users/mdgarts/)
 * (@mdgarts)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/paginate-author-boxes/)
 * I’ve made an author list page template using the author boxes. It works well 
   displaying all authors in the right order but I would like to create pagination
   displaying only 10 author boxes per page. Additionaly, if possible I would like
   to exclude the authors with post status ‘draft”, because right now it shows even
   authors with posts that are drafted and not yet published. Nothing seems to be
   working for me so any help would be greatly appreciated.
 *     ```
       add_action('init','starBoxCustom');
   
       function starBoxCustom(){
           if (!class_exists('ABH_Controllers_Frontend'))
               return;
   
           ABH_Classes_ObjController::getController('ABH_Controllers_Frontend')->custom = true;
       }
   
       function starBoxShow($user_id) {
           if (!class_exists('ABH_Controllers_Frontend'))
               return;
   
           ABH_Classes_ObjController::getController('ABH_Classes_Tools');
   
           $theme = ABH_Classes_Tools::getOption('abh_theme');
   
           $str = '';
           $str .= '<script type="text/javascript" src="' . _ABH_ALL_THEMES_URL_ . $theme . '/js/frontend.js?ver=' . ABH_VERSION . '"></script>';
           $str .= '<link rel="stylesheet"  href="' . _ABH_ALL_THEMES_URL_ . $theme . '/css/frontend.css?ver=' . ABH_VERSION . '" type="text/css" media="all" />';
           $str .= ABH_Classes_ObjController::getController('ABH_Controllers_Frontend')->showBox($user_id);
   
           return $str;
       }
       function contributors() {
           $authors = array();
           // roles you want to include
           $roles = array('editor','author','contributor');
   
           foreach ($roles as $role)  {
               $users_query = get_users(
                   array(
                     'fields' => array('ID', 'user_nicename'),
                     'orderby'    => 'post_count',
                     'order'      => 'DESC',
                     'role' => $role
                   )
               );
               if($users_query) {
                   $authors = array_merge($authors, $users_query);
               }
           }
   
           if(!empty($authors)) {
   
               foreach($authors as $author) {
   
       echo starBoxShow( $author->ID );
       echo "<br />";
               }
           }
       }
       ```
   
 * and I’m calling the function with this:
 * `<div id="authorlist"><ul><?php contributors(); ?></ul></div>`
 * [https://wordpress.org/plugins/starbox/](https://wordpress.org/plugins/starbox/)

The topic ‘paginate author boxes’ is closed to new replies.

 * ![](https://ps.w.org/starbox/assets/icon-256x256.png?rev=1974206)
 * [Starbox - the Author Box for Humans](https://wordpress.org/plugins/starbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/starbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/starbox/)
 * [Active Topics](https://wordpress.org/support/plugin/starbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/starbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/starbox/reviews/)

## Tags

 * [pagination](https://wordpress.org/support/topic-tag/pagination/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [mdgarts](https://wordpress.org/support/users/mdgarts/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/paginate-author-boxes/)
 * Status: not resolved