Forums

[resolved] Display one day's posts AND sort ascending (3 posts)

  1. Sekimori
    Member
    Posted 5 months ago #

    Successfully using the following to only show the current day's entries:

    $today = getdate();
    query_posts('year=' .$today["year"] .'&monthnum=' .$today["mon"] .'&day=' .$today["mday"]);

    Need to also sort by ascending order, but the sort is being completely ignored:

    <?php $posts=query_posts($query_string.'&order=ASC');
    if (have_posts()) : ?>
    
    <?php
    $today = getdate();
    query_posts('year=' .$today["year"] .'&monthnum=' .$today["mon"] .'&day=' .$today["mday"]);
    while (have_posts()) : the_post(); ?>

    What in the name of Zurg do I need to do to get both of these things to happen?

  2. MichaelH
    moderator
    Posted 5 months ago #

    Wny not just this:

    <?php
    $today = getdate();
    query_posts($query_string. '&order=ASC&year=' .$today["year"] .'&monthnum=' .$today["mon"] .'&day=' .$today["mday"]);
    
    if (have_posts()) : 
    
    while (have_posts()) : the_post();
    ?>
  3. Sekimori
    Member
    Posted 5 months ago #

    Blessings upon you, kind sir!

Reply

You must log in to post.

About this Topic