Merge pull request #1085 from IanDelMar/post-navigation-non-archive
Add support for pagination on non-archive pages
This commit is contained in:
commit
bc6358683b
|
@ -41,7 +41,7 @@ if ( ! function_exists( 'understrap_pagination' ) ) {
|
|||
*/
|
||||
function understrap_pagination( $args = array(), $class = 'pagination' ) {
|
||||
|
||||
if ( $GLOBALS['wp_query']->max_num_pages <= 1 ) {
|
||||
if ( ! isset( $args['total'] ) && $GLOBALS['wp_query']->max_num_pages <= 1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,9 @@ if ( ! function_exists( 'understrap_pagination' ) ) {
|
|||
);
|
||||
|
||||
$links = paginate_links( $args );
|
||||
if ( ! $links ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
Reference in New Issue