• nickbrewer

    (@nickbrewer)


    hi all!

    i’m trying to alter the below wp_query to only show posts after the current date/time.

    right now i have the plugin installed that makes all ‘future’ [scheduled] posts mark as ‘publish’. My goal is to list all posts beyond the current date and not list the past posts.

    some of the below code is from a custom theme so the .$catid. variable is custom.

    as of now the query works it just shows all the posts [past and future]. i’m guessing there is some variable i need to compare to the current date. not sure what to do.

    $my_query = new WP_Query("cat=".$catid."&posts_per_page=1&orderby=date&post_status=publish");
                while ($my_query->have_posts()) : $my_query->the_post();

    thanks in advance for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show only posts after current date in wp_query’ is closed to new replies.