I have Google Custom Search set up on my website, and I want to display the search term at the top of the page. `the_search_term();` doesn’t work, as it’s trying to query “s”, but google custom search uses “q” as a term instead of “s”.
I was able to get the search box to point to my search results page by changing the form action from `echo get_bloginfo(‘/’);` (which is the default), to `echo get_bloginfo(‘/search-results’);` which is my results page. I also changed the parameter `name=”s”` to `name=q`, which changes the query term in the URL from `?s=` to `?q=`.
Now, as stated before, I’m trying to get the search term to display in the context of “Search Results: $term”, but no matter what I try it doesn’t seem to work.
I did run across this snippet of code when doing some digging:
Yes, yes, I actually was able to solve this myself!!! I had posted the same question over at the wordpress.org forums. You can get to my original post [here](http://wordpress.org/support/topic/google-custom-search-query-string?replies=3 “the post on wordpress.org”); someone else besides you had this problem. It seemed like there weren’t a lot of responses on this post, so I forgot about it…lol. Anyways, glad to have helped you out.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".