Spørgsmål vedrørende Wordpress
I får lige den her på Engelsk, da jeg har stillet det flere forskellige steder:I am trying to implement Google search on my Wordpress site, instead of the regular WordPress search. I have done this by adding a "Text"-Widget to the sidebar, containing the Google Search Form code:
<form action="http://www.ndroid.dk/gsearch.php" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="partner-pub-4532289770317958:3387073315" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="55" />
<input type="submit" name="sa" value="Søg" />
</div>
</form>
<script type="text/javascript" src="http://www.google.dk/coop/cse/brand?form=cse-search-box&lang=da"></script>
Afterwards i created the page gsearch.php and added it to the root of my host, containing the following code:
<?php get_header(); ?>
<!- BEGIN MAIN ->
<div id="gsearch">
<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 795;
var googleSearchDomain = "www.google.dk";
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
</div>
<!- END MAIN ->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Now, i realize that this won't work, since this page doesn't load my theme files (hence, the gsearch.php is only showing a blank page when trying a search). But i don't know how to fix it.
I want - ofcourse - the search results to be shown as any other "custom" page i add, meaning i want the header, the sidebar and the footer shown still.
What am i missing? :)
Sincerely
Rasmus