Last active
November 7, 2018 11:48
-
-
Save sazzadh/db9f1818e59a41f8ce0baa3027606f2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pagenav{ | |
display: block; | |
text-align: center; | |
padding-top:31px; | |
} | |
.pagenav .page-numbers{ | |
padding: 6px 16px; | |
border: solid 1px rgba(255, 255, 255, 0); | |
display: inline-block; | |
text-decoration: none; | |
text-transform: uppercase; | |
font-size: 14px; | |
font-weight: bold; | |
} | |
.pagenav .page-numbers:hover{ | |
border-color: #D6A347; | |
} | |
.pagenav .page-numbers.current{ | |
color: #D6A347; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function glsa_paginate($query = NULL){ | |
global $wp_query; | |
if( $query == NULL ){ $query = $wp_query; } | |
$output = null; | |
if ($query->max_num_pages > 1) { | |
$output .= '<div class="pagenav">'; | |
$big = 999999999; // need an unlikely integer | |
$output .= paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $query->max_num_pages | |
)); | |
$output .= '</div>'; | |
} | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment