Skip to content

Commit e277d50

Browse files
Sourav61Sourav61t-hamanosarthaknagoshe2002Mamaduka
authored andcommitted
Fix: Correct 'Displaying 1 – 0 of 0' issue when no results are found (#69666)
Unlinked contributors: Manhatthien-98. Co-authored-by: Sourav61 <sourav08@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org>
1 parent bebf515 commit e277d50

File tree

1 file changed

+1
-1
lines changed
  • packages/block-library/src/query-total

1 file changed

+1
-1
lines changed

packages/block-library/src/query-total/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function render_block_core_query_total( $attributes, $content, $block ) {
3434
$posts_per_page = (int) $query_to_use->get( 'posts_per_page' );
3535

3636
// Calculate the range of posts being displayed.
37-
$start = ( $current_page - 1 ) * $posts_per_page + 1;
37+
$start = ( 0 === $max_rows ) ? 0 : ( ( $current_page - 1 ) * $posts_per_page + 1 );
3838
$end = min( $start + $posts_per_page - 1, $max_rows );
3939

4040
// Prepare the display based on the `displayType` attribute.

0 commit comments

Comments
 (0)