Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress google自定义搜索集成不显示结果_Php_Wordpress_Google Custom Search - Fatal编程技术网

Php Wordpress google自定义搜索集成不显示结果

Php Wordpress google自定义搜索集成不显示结果,php,wordpress,google-custom-search,Php,Wordpress,Google Custom Search,我想将谷歌自定义搜索集成到我的wordpress站点 我已经将我的网站添加到谷歌自定义搜索中,我生成了脚本并将其放入我的wordpress页面。我在我的自定义搜索框中键入了一个关键字,然后按下了搜索按钮,它没有显示任何结果 如何解决这个问题 这是我的代码: <script> (function() { var cx = '005684269769708879665:sggzaz_druu'; var gcse = document.createElement('s

我想将谷歌自定义搜索集成到我的wordpress站点

我已经将我的网站添加到谷歌自定义搜索中,我生成了脚本并将其放入我的wordpress页面。我在我的自定义搜索框中键入了一个关键字,然后按下了搜索按钮,它没有显示任何结果

如何解决这个问题

这是我的代码:

<script>
  (function() {
    var cx = '005684269769708879665:sggzaz_druu';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

(功能(){
变量cx='005684269707698879665:sggzaz_druu';
var gcse=document.createElement('script');
gcse.type='text/javascript';
gcse.async=true;
gcse.src=(document.location.protocol=='https:'?'https:':'http:')+
'//www.google.com/cse/cse.js?cx='+cx;
var s=document.getElementsByTagName('script')[0];
s、 parentNode.insertBefore(gcse,s);
})();

你能发布一些谷歌自定义搜索功能的源代码吗?它将帮助我们调试您遇到的问题。@buzzlightyear我编辑了我的问题,添加了代码,检查了它