Skip to content

Commit

Permalink
Default to posts if is_singular
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Sep 5, 2024
1 parent 49ba8ca commit 51f9383
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/post-template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function render_block_core_post_template( $attributes, $content, $block ) {
if ( in_the_loop() ) {
$query = clone $wp_query;
$query->rewind_posts();

// If in a single post of any post type, default to the 'post' post type.
if ( is_singular() ) {
query_posts( array( 'post_type' => 'post' ) );
}
} else {
$query = $wp_query;
}
Expand Down

0 comments on commit 51f9383

Please sign in to comment.