• Hello,

    I’m trying to change the index.php of my theme to something like this:

    If exists more than 1 post from the same day (the last day which has a post)

    show them all(!) in regular view

    else

    show last post in single view

    The 2nd part I already have and it works:

    <?php if (is_home()) {query_posts('showposts=1&cat=-1');} ?>
    <?php $wp_query->is_single = true; ?>

    Additional I have excluded 1 category.

    Background is that I want to show basically only the last post on the index.php. But if I post more than 1 time a day, my first post of the same day would be already “hidden” and not actually allthough it is actually.

    Therefore I need that special loop.
    Does anyone have an idea for the 1st part? My PHP-understanding isn’t really big.

    Thanks to you.
    Ric

  • The topic ‘Need a selection in query_posts’ is closed to new replies.