Support » Plugins » WP_Query not allowing future posts

  • I have a scheduled post, of custom post type “events”. From it’s single page (which I’ve allowed to be viewable via a hack), I call a function in a plugin I built.

    Within the plugin, I run create a new query, like this:

    $query = new WP_Query('p=46913&posts_per_page=1&post_type=any&post_status=future,publish');
    while ( $query->have_posts() ) : $query->the_post();

    Post ID 46913 is the same scheduled post I came to this plugin from. The have_posts function returns false because post_count = 0, because it’s a future post. How do I override / reset / run this loop correctly? I’ve tried a lot of things and the loop just won’t go even though all the other correct info is sitting in $wp_query.

  • The topic ‘WP_Query not allowing future posts’ is closed to new replies.