adhardwick
Member
Posted 1 year ago #
I am using google Adsense for search.
On form submit the action adds a query var string that starts with "?cx="
I want that action to be handled by a file in theme called results.php (instead of search.php or the fallback index.php). Does anyone know how this can be done?
Maybe a filter to add cx to query vars and the a filter to define is_results function?
Run a filter on template_include, check for your query var, if it's present, switch the template to your custom one.
Dump the passed variable inside a callback on that filter before returning it and you'll see what i mean(assuming you know the basics of how filters work).. ;)
You can see the filter in source here, incase it helps.
http://core.trac.wordpress.org/browser/tags/3.3/wp-includes/template-loader.php
adhardwick
Member
Posted 1 year ago #
Thanks Mark,
That's the file I had been scrutinizing. Just taking the week of for vacation.