Trim posts with status future like post status publish

// Trim posts with status future like post status publish
function custom_archive_query($query) {
	if ( $query->is_archive() )
	{
	$query->set('post_status', array('future', 'publish'));
	}
	return $query;
}
add_filter('pre_get_posts', 'custom_archive_query');

Source: 10+ Useful WordPress Code Snippets

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.