Support

Home Forums Event Espresso Premium EE4 – Search Capability

EE4 – Search Capability

Posted: January 25, 2018 at 6:47 pm

Viewing 1 reply thread


prepareinstitute

January 25, 2018 at 6:47 pm

We have multiple events being promoted by direct mail. I’d like to include the event ID on the mailing, and have the registrant go to a landing page, enter that code, and have them taken to the corresponding event page.

The easiest way to achieve that would be to have a search box on the landing page, but I can’t find any shortcode in ee4 to generate a search box? Any help is appreciated!


Josh

  • Support Staff

January 26, 2018 at 8:48 am

Hi there,

That’s an interesting idea. One potential issue with a search form is it will not automatically take the registrant to an event page. This is because a search form will that the user to a search results page.

In any case, Event Espresso (or WordPress itself) doesn’t actually provide a search shortcode, but one can be added with one line of code by following this guide:

http://www.wpbeginner.com/wp-tutorials/how-to-add-search-form-in-your-post-with-a-wordpress-search-shortcode/

After you have a search page set up, you’ll need to add a way for WordPress to search by post ID, because WordPress doesn’t automatically search by post ID. One way to add search by post ID is you install this plugin:
https://wordpress.org/plugins/relevanssi/
then you add a bit of PHP code to allow searching by post ID, outlined here:
https://www.relevanssi.com/knowledge-base/searching-post-id/
This will add post IDs to the search Index.
You’ll also need to set Relevanssi’s index to include espresso_events (set in Settings > Relevanssi > Indexing.
Then after you build the index in Relevanssi’s settings page, you’ll have a functional search form that returns results based on post ID

Viewing 1 reply thread

The support post ‘EE4 – Search Capability’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso