Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Custom Blog Posts Pagination for Bootstrap Theme
- *
- * This function is replacement for:
- * @the_posts_pagination();
- * and is used on home.php template, line: 55
- *
- * It shows nice and clear posts pagination tailored to Bootstrap Theme
- *
- * @since The Bootstrap Blog 0.1
- **/
- function the_bootstrap_blog__the_posts_pagination(){
- global $wp_query;
- if ( $wp_query->max_num_pages > 1 ) {
- $n = "\n";
- $next = get_next_posts_link( __( 'Older', 'the-bootstrap-blog' ) );
- if ( get_query_var( 'paged' ) == '0' ) {
- $prev = '<a class="btn btn-outline-secondary disabled" href="#">' . __( 'Newer', 'the-bootstrap-blog' ) . '</a>';
- } else {
- $prev = get_previous_posts_link( __( 'Newer', 'the-bootstrap-blog' ) );
- }
- $posts_pagination = '<nav class="blog-pagination">' . $n . $next . $n . $prev . $n . '</nav>';
- return $posts_pagination;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement