The blog page should show scheduled posts in the main loop. I've done that with this code:
/**
* Show scheduled posts in main loop
*/
function fa_show_scheduled_posts( $query ) {
if( $query->is_main_query() && ! is_admin() && $query->is_home() ) {
$query->set( 'post_status', [ 'publish', 'future' ] );
}
}
add_action( 'pre_get_posts', 'fa_show_scheduled_posts' );
But there's a different section that shows the 4 latest posts with a WP_Query. Even if I change the post status to only be published posts, it shows the scheduled posts.
Is there a way to show them in the main loop but not the WP_Query?
My WP_Query code:
<?php
$args = array(
'showposts' => 4,
'post_status' => array( 'published''publish' )
);
$the_query = new WP_Query( $args );