キタジマ様
申し訳ありません、こちらにコードを書くために念のため自身で1から書き直してみたところ上手くいきました。
恐らくどこかで抜け漏れがあったものと思います。お騒がせ致しました。
ご共有までコードを以下貼り付けの上、本トピックはクローズさせていただきます。
add_action(
'snow_monkey_before_contents_inner',
function() {
$new_query = new \WP_Query(
[
'pagename' => 'blog_before_content',
'post_type' => 'page',
'post_status' => [ 'publish', 'draft' ],
'posts_per_page' => 1,
]
);
if ( ! is_home() ) {
return;
}
$new_query->the_post();
?>
<div class="p-entry-content" id="blog_before_content">
<?php the_content(); ?>
</div>
<?php
wp_reset_postdata();
}
);