From ebe4feed491eb2c5720efd6b433d3ba40bdc91b4 Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Wed, 2 Sep 2026 14:37:18 +0530 Subject: [PATCH] Query: Do not replace the posts page with the front page when previewing. --- src/wp-includes/class-wp-query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 9385ae832ff66..d013192785c25 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -2049,7 +2049,10 @@ public function get_posts() { $query_vars['comments_per_page'] = get_option( 'comments_per_page' ); } - if ( $this->is_home && ( empty( $this->query ) || 'true' === $query_vars['preview'] ) && ( 'page' === get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) ) { + if ( $this->is_home && ! $this->is_posts_page + && ( empty( $this->query ) || 'true' === $query_vars['preview'] ) + && ( 'page' === get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) + ) { $this->is_page = true; $this->is_home = false; $query_vars['page_id'] = get_option( 'page_on_front' );