One day's posts per page

I’m trying to display a single day’s posts per page, but am going nowhere fast with the codex.

Any suggestions on a query to make this happen?

  • ymousley
    • Site Builder, Child of Zeus

    Hi Phil,

    I probably should have added that I’m working with a few other selectors (separating the display by category) as well.

    Say there’s category 1 posts and category 2 posts each day, I want to display all from the same day on the same page, but I want to put photo posts (which have their own category) on top, text posts below them. The daily archives are actually the perfect set-up structure wise, but creating custom queries the way that you can for the homepage is a bit more difficult.

    Trying a little bit more, I came up with this

    $my_query = new WP_Query( $query_string . '&cat=1&day=' . date( 'd', current_time( 'timestamp' ) ));

    which actually did the trick. It shows posts only from category 1, and only for the current day.

    Now if I can figure out how to get this set up for the archives, and display the first day of the daily archives as the homepage I think I’ll have this completely taken care of.

    Thanks for helping me not overthink it beyond that.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.