Skip to content

Instantly share code, notes, and snippets.

@jfeliweb
Created October 10, 2014 21:45
Show Gist options
  • Save jfeliweb/740a4cd5110f42a8f972 to your computer and use it in GitHub Desktop.
Save jfeliweb/740a4cd5110f42a8f972 to your computer and use it in GitHub Desktop.
Numbered Page Navigation
<!-- Paging Start -->
<div class="paging">
<ul>
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
$args = array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?page=%#%',
'total' => $wp_query->max_num_pages,
'current' => max( 1, get_query_var( 'paged') ),
'show_all' => false,
'end_size' => 3,
'mid_size' => 2,
'prev_next' => True,
'prev_text' => __('&laquo; Previous'),
'next_text' => __('Next &raquo;'),
'type' => 'list',
);
echo paginate_links($args);
?>
</ul>
</div> <!-- paging -->
<!-- // Paging End -->
/*Pagnation CSS*/
.paging ul {
float: left;
margin: 5px;
padding-left: 0px;
}
.paging ul li {
float: left;
margin: 2px;
list-style-type: none;
}
.paging ul li a{
font-size: 1.2em;
padding: 2px;
}
.paging ul li .current, .paging ul li .dots {
padding:7px 11px 7px 11px;
font-size:12px;
}
.paging ul li a:hover {
font-size: 1.1em;
color: #0050AB;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment