<?php
if ( get_query_var( 'paged') )
$paged = get_query_var('paged');
else if ( get_query_var( 'page') )
$paged = get_query_var( 'page');
else
$paged = 1;
$per_page = 5;
$number_of_series = count( get_terms( 'category') );
$offset = $per_page * ( $paged - 1);
// Setup the arguments to pass in
$args = array(
'offset' => $offset,
'number' => $per_page,
'hide_empty'=>'0'
);
// Gather the series
$series = get_terms( 'category', $args );
// Loop through and display the series
foreach($series as $s)
{
$theurl = get_term_link($s, 'category');
echo "<div class=\"ser-img img\" ><a href=\"" . $theurl . "\">". $s->name ."</a>";
}
echo "<br />";
$big = 999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current'=> $paged,
'total' => ceil( $number_of_series / $per_page ) // 3 items per page
) );
?>
if ( get_query_var( 'paged') )
$paged = get_query_var('paged');
else if ( get_query_var( 'page') )
$paged = get_query_var( 'page');
else
$paged = 1;
$per_page = 5;
$number_of_series = count( get_terms( 'category') );
$offset = $per_page * ( $paged - 1);
// Setup the arguments to pass in
$args = array(
'offset' => $offset,
'number' => $per_page,
'hide_empty'=>'0'
);
// Gather the series
$series = get_terms( 'category', $args );
// Loop through and display the series
foreach($series as $s)
{
$theurl = get_term_link($s, 'category');
echo "<div class=\"ser-img img\" ><a href=\"" . $theurl . "\">". $s->name ."</a>";
}
echo "<br />";
$big = 999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current'=> $paged,
'total' => ceil( $number_of_series / $per_page ) // 3 items per page
) );
?>
Comments
Post a Comment