• Is it possible, for either the Free or Premium version, to show an alert at the top of the search results list for specific searches?

    I want to use this for a query like “newsletter”: my site does not have a newsletter, but I do have social media accounts. So I could then show an alert like “I see you searched for ‘newsletter’. My site does not have one, but you can follow me on these social media sites: …”.

    Preferably this would be possible without coding, but if that is what it takes I can handle that 🙂
    I tried realizing this via a custom post type, but that turned out to not be a usable solution for this.

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    The easiest solution for this doesn’t have anything to do with Relevanssi, free or Premium. I’d do this on the search results template of your theme.

    Just add something like this to your template:

    <?php if ( 'newsletter' === get_search_query() ) : ?>
    <div class="newsletter_alert">I see you searched for ‘newsletter’. My site does not have one, but you can follow me on these social media sites: ...</div>
    <?php endif; ?>

    I think this is the best solution. Another option is to create a page called “Newsletter” that would contain the same information, but if you want the information on the search results template, it’s easiest to just edit the template.

Viewing 1 replies (of 1 total)

The topic ‘Show alert for specific queries?’ is closed to new replies.