Skip to content

Instantly share code, notes, and snippets.

@milanarandjelovic
Last active January 11, 2021 11:51
Show Gist options
  • Save milanarandjelovic/ffa8f6c2794f0e2ffc360405121034fb to your computer and use it in GitHub Desktop.
Save milanarandjelovic/ffa8f6c2794f0e2ffc360405121034fb to your computer and use it in GitHub Desktop.
WordPress - Template for displaying post pagination (Bootstrap Pager).
<?php
/**
* Template for displaying post pagination.
*
* @package WordPress
* @subpackage WPBootstrap
* @author Milan Arandjelovic
*/
?>
<nav class="navigation paging-navigation" role="navigation">
<ul class="nav-links pager">
<?php if ( get_next_post_link() ): ?>
<li class="nav-previous previous">
<?php next_posts_link(
wp_kses( __( '<span class="meta-nav">&larr;</span> Older posts', 'wp_bootstrap' ),
array( 'span' => array( 'class' => array() ) ) )
); ?>
</li> <!-- /.nav-previous -->
<?php endif; ?>
<?php if ( get_previous_posts_link() ): ?>
<li class="nav-next next">
<?php previous_posts_link(
wp_kses( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'wp_bootstrap' ),
array( 'span' => array( 'class' => array() ) ) )
); ?>
</li> <!-- /.nav-previous -->
<?php endif; ?>
</ul> <!-- /.nav-links -->
</nav> <!-- /.navigation -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment