Paginate Category list wordpress
<p>How to put this category list in a pagination because currently I have a code that show all the list of category including post by category.
The problem is how to make it paginate if the category list exceed by 10.</p>

<pre><code> $cats = get_categories("exclude=1,5,15"); 

            foreach ($cats as $cat) {
                    // setup the cateogory ID
                        $cat_id= $cat-&gt;term_id;
                        $cat_child =$cat -&gt; category_parent;

                    // Make a header for the cateogry
                        echo "&lt;div class='anchor2' id='cat_".$cat_id. "'&gt;&lt;/div&gt;";
                        echo "&lt;div id='". $cat_child ."'class='cat_id".$cat_id." cat-cont large-6 medium-6 columns pad25px'&gt;";
                        echo "&lt;h5 class='title-post cat_id_" . $cat_id ."' &gt;".$cat-&gt;name."&lt;/h5&gt;";
                        echo "&lt;a href='dev/all/#cat_".$cat_id."' class='see-more' target='_blank'&gt;See more &gt;&gt;&lt;/a&gt;";

                        // create a custom wordpress query
                        query_posts("cat=$cat_id&amp;posts_per_page=5&amp;depth=1");

                        // start the wordpress loop!
                        if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

                            &lt;?php // create our link now that the post is setup ?&gt;

                            &lt;?php get_template_part( 'parts/loop', 'archive-grid' ); ?&gt;

                        &lt;?php endwhile; ?&gt;

                        &lt;?php else : ?&gt;             
                                &lt;?php get_template_part( 'parts/content', 'missing' ); ?&gt;
                        &lt;?php  endif; // done our wordpress loop. Will start again for each category ?&gt;

            &lt;?php echo "&lt;/div&gt;";}// done the foreach statement ?&gt;
</code></pre>