diff --git a/packages/block-library/src/post-template/index.php b/packages/block-library/src/post-template/index.php index 284cf3f89673fe..c12a0e68b8e248 100644 --- a/packages/block-library/src/post-template/index.php +++ b/packages/block-library/src/post-template/index.php @@ -48,7 +48,7 @@ function render_block_core_post_template( $attributes, $content, $block ) { $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ); if ( $use_global_query ) { global $wp_query; - $query = $wp_query; + $query = clone $wp_query; } else { $query_args = build_query_vars_from_query_block( $block, $page ); $query = new WP_Query( $query_args ); @@ -99,9 +99,12 @@ function render_block_core_post_template( $attributes, $content, $block ) { $content .= '