Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    Just to clarify, are you using the search function that comes with WordPress or the one that comes with Events Manager?

    Thread Starter andredewaard

    (@andredewaard)

    hello,

    I’m using the search function that comes with WordPress and filtered that it only shows the events and locations.
    Thanks.

    Hiya,

    The default EM search already does this – is there a specific reason why you’re not using that?

    I ask only because there might be a simpler way of achieving your aim…

    Thanks

    Thread Starter andredewaard

    (@andredewaard)

    Hello,

    Because i did not succeed to get the em search working in my sidebar as a widget.
    Thnx.

    Can you post the code you used to filter the search function? We can probably suggest an edit for it.

    Thread Starter andredewaard

    (@andredewaard)

    I’m now using the plugin relevanssi. In this plugin i can choose on which custom post-types can be searched.
    Thanks

    The plugin page for Relevanssi mentions it has “Advanced filtering to help hacking the search results the way you want.” That suggests there are filters available to help you do what you want, so you’ll need to contact the developer to see how you’d do this.

    In terms of Events Manager, the database columns that store the date are called event_start_time, event_start_date, event_end_time and event_end_date and are all in the database table called wp_em_events. You’d probably need to use that info in any custom filter you wrote.

    Thread Starter andredewaard

    (@andredewaard)

    I’m now only searching trough the custom post-type within the search form with: <input type=”hidden” name=”post_type” value=”events” />.
    And i dont use Relevanssi anymore.
    I found that code here: https://spigotdesign.com/custom-search-forms-wordpress/.
    It is still showing past events.

    That’s because you’ll need to filter the search results based on whether an event is in the past or not. Normal WordPress posts and pages don’t have a “past” status – they’re either published (and in search results) or not.

    You’d need to either write a custom search filter or get the Events Manager search function working.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Search sidebar past events’ is closed to new replies.