Fix shortcode page var

This commit is contained in:
Tetrakern 2023-09-16 01:19:12 +02:00
parent 66fe10b580
commit ef4a8cd430
2 changed files with 2 additions and 2 deletions

View File

@ -1496,7 +1496,7 @@ function fictioneer_shortcode_article_cards( $attr ) {
'author' => $attr['author'] ?? false,
'order' => $attr['order'] ?? 'DESC',
'orderby' => $attr['orderby'] ?? 'date',
'page' => get_query_var( 'page' ) ?? get_query_var( 'paged' ) ?? 1,
'page' => max( 1, get_query_var( 'page' ) ?: get_query_var( 'paged' ) ),
'posts_per_page' => $attr['per_page'] ?? get_option( 'posts_per_page' ),
'post_ids' => fictioneer_explode_list( $attr['post_ids'] ?? '' ),
'author_ids' => fictioneer_explode_list( $attr['author_ids'] ?? '' ),

View File

@ -53,7 +53,7 @@ if ( $args['count'] > 0 ) {
$query_args['posts_per_page'] = $args['count'];
$query_args['no_found_rows'] = true;
} else {
$query_args['paged'] = max( 1, $args['page'] );
$query_args['paged'] = $args['page'];
$query_args['posts_per_page'] = $args['posts_per_page'];
}