WordPress.org

Ready to get started?Download WordPress

Forums

WordPress showing unpublished posts (1 post)

  1. clouder
    Member
    Posted 6 months ago #

    Basically I created a custom page template using this wp query code

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( 'content', 'page' ); ?>
    	<?php endwhile; else: endif; ?>
    
    	<?php global $wp_query;
    
    	$wp_query = new WP_Query('category_name='.get_the_title().'&post_status=publish,future'.'&showposts=8'.'&paged='.$paged);?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    /***************I cut out the unrelated codes****************/
    
    	<?php endwhile; else: endif; ?>

    The problem is when I schedule a post for a future date, it displays it in the page using this custom page template.

    Does anyone know the conditional tag for scheduled posts so I could exclude it?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.