*bump*
No really though, I know lots of people do this, can anyone help please? 🙂
In case anyone needs help with this in the future, I figured it out and this is what I did:
1. Google provides you with two sets of code. The code in the top box the code that generates the search box. Find your theme’s search box code. Mine was in the header file. I just deleted the old code and inserted the new code.
2. Then, I created a page called Search Results. For the slug, I named it search-results.
3. In the HTML view of the search-results page, paste the 2nd code provided by Google. Save the page.
That’s it! From that point, it’s pretty much finished and ready to go, but here’s some other notes that might answer a question or two:
I excluded the Search Results page out of my navigation since it won’t be in use except when someone uses search. I suggest you do the same unless you want a random search page with nothing on it showing in your navigation.
Also, you will need a search.php file in your theme for this to work, I think. Not entirely sure, but pretty sure. My theme has one, but I’m too much of a chicken to delete it and see if it still works, so I just leave it there.
If you need to make a search.php file, that’s beyond my level of experience, but I will leave this thread open as unresolved for a few days in case anyone has any questions about implementing Google Custom Search.
Hi melstan1,
There’s a plugin which allows you to do this.
http://wordpress.org/extend/plugins/google-custom-search/
I’ve done it creating a page from the dashboard (like you) without the search.php in my theme and my custom search works perfect when I search from my home page.
However, when I search from a category page, for some reason I get a 404 Error – file not found every time. Even when I know the search parameters I’m tying to query are in fact tags that should be found.
Have you tested to see if your search box is working on the pages outside your home page? Just curious.
Thanks.
By the way, I’m dying to get some help on my troubleshooting question regarding google custom search if someone could help me. Here’s my post asking for help: http://wordpress.org/support/topic/google-custom-search-in-wordpress-1?replies=1