Skip to content

Instantly share code, notes, and snippets.

@webhasan
Created February 12, 2014 06:43
Show Gist options
  • Save webhasan/8951001 to your computer and use it in GitHub Desktop.
Save webhasan/8951001 to your computer and use it in GitHub Desktop.
wp:post pagination
/**
* Style for post pagination
*/
.post-pagination {
width: 100%;
padding:5px;
height: 40px;
border:1px solid #fff;
outline: 1px solid #e3e3e3;
border-radius:3px;
background:#fff;
}
/* STYLE FOR PAGINATION */
.pagination {
text-align: center;
}
.pagination ul li a {
color:#3d99ca;
}
.pagination ul li a:hover {
background: rgba(0,0,0,.03);
}
.pagination ul {
display: inline-block;
margin-bottom: 9px;
}
.pagination ul>li {
display: inline;
}
.pagination ul>li:first-child>a,.pagination ul>li:first-child>span {
border-left-width: 1px;
border-radius: 5px 0 0 5px;
}
.pagination ul>li:last-child>a,.pagination ul>li:last-child>span {
border-rigth-width: 1px;
border-radius: 0 5px 5px 0;
}
.pagination ul>li>a,.pagination ul>li>span {
float: left;
padding: 4px 12px;
line-height: 20px;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
border-left-width: 0;
}
/**
* Function for wordpress post excerpt
*/
function excerpt($num) {
$limit = $num+1;
$excerpt = explode(' ', get_the_excerpt(), $limit);
array_pop($excerpt);
$excerpt = implode(" ",$excerpt)." <a href='" .get_permalink($post->ID) ." ' class='".readmore."'>Read More &rsaquo;&rsaquo;</a>";
echo $excerpt;
}
<div class="post-pagination">
<?php wp_pagination(); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment