Forums

[resolved] Search Everything searches for future dated posts (2 posts)

  1. haagendazs1
    Member
    Posted 3 years ago #

    Hey

    I'm using the "Search Everything" plugin. What I use it for is to exclude 2 different categories, and to search for metadata as well. However, if I use it, the search finds future-dated posts also! Upon clicking it, it would give the 404 page. However, is there a way to modify the query somehow so that future posts aren't displayed? Or a conditional tag? Or to modify the plugin somewhere? I emailed the plugin's author but he hasn't responded yet...

    thanks everyone

  2. haagendazs1
    Member
    Posted 3 years ago #

    oh i think i got this one. instaed of using the_date i used get_the_time()

    so just make a variable

    <?php $thispostdate = get_the_time('YmdHis');
    $currentdate = date('YmdHis'); ?>

    then make an if statement saying if thispostdate is before currentdate, then show

    <?php if ($thispostdate < $currentdate) : ?>
    bla bla bla
    <?php endif; ?>

    this works because the date format YmdHis will always have 14 characters in it

Topic Closed

This topic has been closed to new replies.

About this Topic