WordPress.org

Support

Support » Miscellaneous » Including search terms in results pages

Including search terms in results pages

  • Is there a way to include the search terms on the search results page? For instance, I’d like an empty result to display something along the lines of “No entries were found containing the word(s) XYZ.” Is that possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • sure, the search terms are put into an array named $s_array

    thats as much as info as I can share as I have to leave for work — Im guessing someone else can elaborate on what you’ll need to do with that.

    ok, so here is how and its simpler than I imagined; so simple I’m surprised someone else didnt answer this for ya.

    The search terms are one variable, using any search related plugins may change that, obviously.

    So anyway, where the default message is outputted in the event nothing is found just include <?php echo $s; ?> to echo back the searched terms.

    example here:

    http://www.village-idiot.org/search/pookie%20moo

    Ive used a highlite trick just to make it stand out more.

    neat idea, btw.

    Thanks a lot! That’s exactly what I was looking for.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Including search terms in results pages’ is closed to new replies.
Skip to toolbar