Merge pull request #1085 from IanDelMar/post-navigation-non-archive

Add support for pagination on non-archive pages
This commit is contained in:
UnderstrapFramework 2019-12-16 08:10:44 +00:00 committed by GitHub
commit bc6358683b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,7 @@ if ( ! function_exists( 'understrap_pagination' ) ) {
*/ */
function understrap_pagination( $args = array(), $class = '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; return;
} }
@ -59,6 +59,9 @@ if ( ! function_exists( 'understrap_pagination' ) ) {
); );
$links = paginate_links( $args ); $links = paginate_links( $args );
if ( ! $links ) {
return;
}
?> ?>