Support » Fixing WordPress » question about the_search_query()

  • Hi, I’m trying to pass along search queries to my own php variable, but the_search_query() seems to only directly output content to the browser. In other words, this doesn’t seem to work:
    $SearchQuery = the_search_query();


    – Is there a function for search similar to what the_title(false) or get_the_title allow?

    – does the_search_query() work only inside the Loop?

    Any help appreciated, thanks. I have searched the codex, this forum, and Google, and found very little information about the WordPress search engine.

    While I’m at it, suggestions to improve the documentation:

    – put something at

    – add a search section in

Viewing 1 replies (of 1 total)
  • Well, since we’re using a GET search form, I went ahead and used the PHP variable from the URL parameter instead ($s). It still wouldn’t hurt to have more documentation about WordPress search.

Viewing 1 replies (of 1 total)
  • The topic ‘question about the_search_query()’ is closed to new replies.