【问题标题】:Google custom search on wordpress谷歌在 wordpress 上的自定义搜索
【发布时间】:2014-03-26 16:22:21
【问题描述】:

Google 自定义搜索最近停止在客户的网站上运行。这是源代码

<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1', {language : 'en'});
  google.setOnLoadCallback(function(){
    var customSearchControl = new google.search.CustomSearchControl('URLGOESHERE/');
    customSearchControl.setResultSetSize(google.search.Search.SMALL_RESULTSET);
    customSearchControl.draw('cse');
  }, true);
</script>

这是要使用的最新代码吗?我一直在查看此代码最近是否已被 Google 更改,但看不到任何内容。

问题是搜索按钮不让你搜索,几乎就像它被关闭了一样。

任何帮助将不胜感激,谢谢。

【问题讨论】:

  • CustomSearchControl('URLGOESHERE/') - 在第 5 行 - 您是否已经更改了 url?
  • 是的,我做到了,这表明我需要保密的客户网址 - 抱歉,我知道这有助于解决问题。
  • 控制台有错误吗?

标签: html wordpress search


【解决方案1】:

您可以在 iframe 中使用此代码

<form id="cse-search-box" action="http://google.com/cse">
  <input type="hidden" name="cx" value="YOUR SEARCH ENGINE ID goes here" />
  <input type="hidden" name="ie" value="UTF-8" />
  <input type="text" name="q" size="31" />
  <input type="submit" name="sa" value="Search" />
</form>
<img src="http://www.google.com/cse/images/google_custom_search_smwide.gif">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    • 2013-01-21
    相关资源
    最近更新 更多