<?php
$args = array(
'parent' => 0,
'hide_empty' => 0
);
$categories = get_categories( $args );
echo $cat = ceil(count( $categories )/5);
?>
<?php
$j=0;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts_per_page = 5;
$offset = ($posts_per_page * $paged) - 5 ;
$args = array(
'orderby' => 'name',
'parent' => 0,
'hide_empty' => 0,
'number' => $posts_per_page,
'offset' => $offset,
'posts_per_page' => 5,
'paged' => $paged
//'exclude' => '1,3,24,9'
);
$categories = get_categories( $args );
foreach ( $categories as $category ) {
$j++;
//echo '<a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a><br/>';
$catname = $category->name;
$catttid = $category->term_taxonomy_id;
//}
?>
<div class="row"><h3 class="cat-title"><?php echo $catname; ?></h3><hr class="space" /></div>
<?php } ?>
</div></div>
<!-- #main -->
</div><!-- #primary -->
<?php
$big = 999999999; // need an unlikely integer
echo '<div class="paginate-links">';
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'prev_text' => __('<<'),
'next_text' => __('>>'),
'current' => max( 1, get_query_var('paged') ),
'total' => $cat
) );
echo '</div>';
?>