Add support for non-archive pages
By relaxing the exit condition understrap_pagination() may be used in custom loops. See #1054 for an how to example.
This commit is contained in:
parent
2f752095a6
commit
ecda11ac10
|
@ -12,7 +12,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@ if ( ! function_exists( 'understrap_pagination' ) ) {
|
||||||
);
|
);
|
||||||
|
|
||||||
$links = paginate_links( $args );
|
$links = paginate_links( $args );
|
||||||
|
if ( ! $links ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Reference in New Issue