• I wanna put in the header of my theme text link which should bring visitor for archive of posts for TODAy.

    The same link needed for YESTERDAY’s posts.

    I hope you can help me.

Viewing 1 replies (of 1 total)
  • Did you checked https://codex.www.ads-software.com/Class_Reference/WP_Query

    Here is one example.

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

    OR you can also do a query post like:

    $today = getdate();
    $args = array(
        'year' => $today["year"],
        'monthnum' => $today["mon"],
        'day' => $today["mday"]
    );
    
    query_posts($args);

    then you do the loop. Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘How to code "Today's posts" link’ is closed to new replies.