Quantcast
Channel: help – WordPress.org Forums
Viewing all articles
Browse latest Browse all 13924

bcworkz on "Google Custom Search with built-in Search Box"

$
0
0

It would have been useful if you mentioned your Basic theme was from Themify. No big deal, I figured it out, I only mention it for the benefit of anyone else following along.

I'm not too clear how searchform.php enters into the picture, as the header.php template makes a call to get_search_form(). Probably a filter hook I couldn't find. The only reason this matters is in deciding the best place to place your edits. I would go to the source and edit header.php, but editing searchform.php apparently works equally well. Whichever file you use, you should create a child theme to contain the altered file.

You can't really keep the same search box, you need to use Google's script, but you can place it in the same place and style it in the same manner. Thus you should replace all of the WP search box code with Google's script inside <div> tags.

Unfortunately, I don't have any experience with setting up GCS on any site, much less a WP site. It appears to not be intended to redirect to any particular page, rather to insert the results onto the current page, the default is for the results to be in a modal. Thus you probably need to add the adsense results script to a template that will be used on any page. You might be limited to header.php or footer.php and maybe sidebar.php.

I'm sorry I can't be more specific about the Google side of things, I hope you find this useful never the less. Good luck!


Viewing all articles
Browse latest Browse all 13924

Trending Articles