WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Sekimori
    Member
    Posted 4 years 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
    Member
    Posted 4 years 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 4 years ago #

    Blessings upon you, kind sir!

Topic Closed

This topic has been closed to new replies.

About this Topic