Title: Multipage get_categories function
Last modified: August 19, 2016

---

# Multipage get_categories function

 *  [theone2k1](https://wordpress.org/support/users/theone2k1/)
 * (@theone2k1)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/multipage-get_categories-function/)
 * Hi, I used the following codes to list all the categories that I have on my site,
   but the issue is that I have too many categories (100+). So, I would like to 
   paginate the category listing. (i.e 10 categories each page… etc) I don’t know
   how I would approach this using the get_categories function within WordPress.
   Help??? Thanks!
 *     ```
       <?php
       $args=array(
         'orderby' => 'name',
         'order' => 'ASC'
         );
       $categories=get_categories($args);
         foreach($categories as $category) {
           echo '<p>Category: <a>term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
           echo '<p> Description:'. $category->description . '</p>';
           echo '<p> Post Count: '. $category->count . '</p>';  }
       ?>
       ```
   

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

 *  [pcs2112](https://wordpress.org/support/users/pcs2112/)
 * (@pcs2112)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/multipage-get_categories-function/#post-1883330)
 * did anybody find a solution?
 *  [docbrandes](https://wordpress.org/support/users/docbrandes/)
 * (@docbrandes)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/multipage-get_categories-function/#post-1883812)
 * I have this same issue … I’m using a get_categories array and am returning a 
   list of 100+ cats, so I want to paginate the list. Please help! There’s got to
   be a way to do this!
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/multipage-get_categories-function/#post-1883813)
 * Use `get_terms`, create your own paging and adjust the offset as necessary..
 * For example purposes.
 *     ```
       $catnum = 5;
       $catpage = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
       $offset = ($catpage - 1) * $catnum;
       $cats = get_terms( array(
         'orderby' => 'name',
         'order' => 'ASC',
         'number' => $catnum,
         'offset' => $offset
       ) );
       ```
   
 * I don’t have time to follow up on this or test code, so i hope the example helps.

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

The topic ‘Multipage get_categories function’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [multipage](https://wordpress.org/support/topic-tag/multipage/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 3 replies
 * 4 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/multipage-get_categories-function/#post-1883813)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
