• I run a few loops on various parts of my website. One pulls posts on events that are dated. I am able to limit the query_post to that category. How do I limit the posts displayed to a specific date? I am currently limiting it by only pulling a specific number of posts.

    you can view it here: https://www.pdxjazz.com/events/

    This way after the event date the post will no longer post to my page? Thus the event that was on 10/14 will be visible until 10/14, but on 10/15 the post will not.

    Thanks for you help.

Viewing 1 replies (of 1 total)
  • This code can be used in your loop for posts that are so may days old date (in this case 46 days)

    <?php
    $mylimit=46 * 86400; //days * seconds per day
    $post_age = date('U') - get_post_time('U');
    if ($post_age < $mylimit) {
    echo 'this post is within my date limit ';
    }
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Limits by Date’ is closed to new replies.