Forums Forums Search & Filter Pro Removing old posts from search

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #39510

    Hi Ross,
    hope you’re doing well.

    As usual your plugin is kicking ass no issues with it. Also now making a new horizontal layout.

    My question: we have an event post type that is included in our search. I would like (just for the events type) the search plugin not to show results (posts) older than the current date.

    There’s a bit of code you can advise me to use for this?

    thanks

    Ross Moderator
    #39545

    Hey again ๐Ÿ™‚

    You can edit the query yourself here:

    https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Edit_Query_Arguments

    So you could restrict the date range as per the wordpress docs:

    https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters

    Thanks

    Anonymous
    #39651

    I’ll ask a developer to take a look. I’m always impressed by your docs Ross.

    Which file I should edit? I mean: I can make this customisation and still have the chance to update the plugin in the future?

    thanks

    Ross Moderator
    #39653

    Ah yes, you can add the code to functions.php in your theme like most WP filters ๐Ÿ™‚ So of course you are free to update the plugin!

    Best

    Anonymous
    #39657

    Awesome I’ll take a look at it let’s see if I can do it by myself ๐Ÿ™‚

    Logic is easy: for post type events show just posts from today on

Viewing 5 posts - 1 through 5 (of 5 total)