Hallo zusammen!
Ich versuche gerade, die Besucherdefinierte Suche von google bei mir (wieder) einzubauen, aber das funktioniert irgendwie nicht.
Den Code
Code
<!-- Put the following javascript before the closing </head> tag. -->
<script>
(function() {
var cx = 'xxxxxxxxxxxxxxx:kkcfa-s2tog';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.de/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
<!-- Place this tag where you want the search box to render -->
<gcse:searchbox-only></gcse:searchbox-only>
Alles anzeigen
habe ich bei mir in die Sidebar eingebaut.
Den Code
Code
<!-- Put the following javascript before the closing </head> tag. -->
<script>
(function() {
var cx = 'xxxxxxxxxxxxxxxxxxxxxx:kkcfa-s2tog';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.de/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
<!-- Place this tag where you want the search results to render -->
<gcse:searchresults-only></gcse:searchresults-only>
Alles anzeigen
habe ich in die Seite Suche.php eingebaut.
Aber wie gesagt leider ohne Erfolg.
Die suche.php schaut so aus:
PHP
<?php
/**
* @package WordPress
* @subpackage Yoko
* Template Name: Suchergebnisse
*/
get_header(); ?>
<div id="wrap"><div id="main">
<div id="content">
<h2>Suchergebnisse</h2><!-- Put the following javascript before the closing </head> tag. --> <script> (function() { var cx = 'xxxxxxxxxxxxxxxxxxx:kkcfa-s2tog'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.de/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })();</script><!-- Place this tag where you want the search results to render --><gcse:searchresults-only></gcse:searchresults-only>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Woran kann das liegen??