Created
July 23, 2014 10:45
-
-
Save joldnl/939e3ac616b5bbc3ca6f to your computer and use it in GitHub Desktop.
WP Pagination
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
.pagination { | |
position: relative; | |
text-align: center; | |
font-size: 16px; | |
padding-top: 20px; | |
padding-bottom: 20px; | |
a, | |
.dots, | |
.current { | |
font-family: "Arial Black"; | |
font-size: 20px; | |
font-weight: bold; | |
text-align: center; | |
text-decoration: none; | |
width: 40px; | |
display: inline-block; | |
background: @clrGrayDark; | |
color: @clrRed; | |
border: 0px; | |
margin: 0px 2px 0px 2px; | |
padding: 10px 0px 10px 0px; | |
&:hover { | |
// background: @clrGray !important; | |
color: @clrWhite; | |
} | |
} | |
.prev { | |
.sprite(-288px, -192px); | |
background-color: @clrGrayDark; | |
text-indent: -999999px; | |
} | |
.next { | |
.sprite(-287px, -92px); | |
background-color: @clrGrayDark; | |
text-indent: -999999px; | |
} | |
.current { | |
font-weight: bold; | |
display: inline-block; | |
// background: @clrGreen !important; | |
text-align: center; | |
color: #FFF; | |
border: 0px; | |
background: @clrRed; | |
color: #FFF; | |
&:hover { | |
// background: @clrGreen !important; | |
color: #FFF; | |
} | |
} | |
} |
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 | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
$paginate_args = array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $wp_query->max_num_pages, | |
'prev_text' => "«", | |
'next_text' => "»", | |
); | |
if(paginate_links($paginate_args) != "") { | |
?> | |
<div class="pagination"> | |
<?php echo paginate_links($paginate_args); ?> | |
</div> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment