WordPress: Add a filter for “todays posts” to wp_query

I am running this query here to print out posts on my wordpress index page:

query_posts( $query_string . ‘&order=ASC’ . ‘&post.status=future,publish’ );

Read More

It gives me posts that either have the status publish or future in ascending order. Now I want to add a filter that this query only shows posts of TODAY. So posts that have been published at the current date.

Can you please help me with this? I tried a lot but nothing worked or changed anything at all, so I hope you guys have some input.

Thanks so much in advance!

Related posts

Leave a Reply

1 comment

  1. Maybe something like this:

    $today = getdate();
    $year=$today["year"];
    $month=$today["mon"];
    $day=$today["mday"];
    
    query_posts( $query_string.'order=ASC' . '&post.status=future,publish'.'&year='.$year.'&monthnum='.$month.'&day='.$day );