The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Posts for Certain Date as Front page? (2 posts)

  1. damonw545
    Posted 9 years ago #

    Hi all,

    I'm using WordPress to manage a small weekly newspaper's web site. Previously we had a static front page and then you would click on the "latest issue" link (created by wp_get_archives('type=daily&limit=1');) to view the latest issue's articles.

    Now I want the front page to show ONLY the posts from the date of the latest post... In other words, only the past week's issue.

    Is there a way to do this? I'm stumped!

    Thank you,

  2. damonw545
    Posted 9 years ago #

    I DID IT!

    Here's how:

    In home.php just before the loop:

    $fulldate=explode('-', get_lastpostdate());
    $day=explode(' ', $fulldate[2]);
    $day = $day[0];
    <?php query_posts("&year=$year&monthnum=$month&day=$day"); ?>

    [[THE LOOP]]

Topic Closed

This topic has been closed to new replies.

About this Topic