将百度站内搜索添加到侧边小工具中

鉴于Google一直无法正常使用,Wordpress自带搜索功能又太弱,所以决定将百度站内搜索集成到HotNews主题侧边小工具中,用下面代码替换HotNewspro\includes\widget目录的search_g.php中的所有内容:


 

  1. <h3>搜一搜</h3>
  2. <div class="box_c">
  3.     <div class="search_k">
  4.         <form action="http://www.baidu.com/baidu" target="_blank">
  5.         <input name=word size="26" maxlength="100" class="swap_value">
  6.         <input type="image" src="<?php bloginfo('template_directory'); ?>/images/go.gif" id="go" alt="Search" title="搜索" />
  7.         <input name=tn type=hidden value="bds">
  8.         <input name=cl type=hidden value="3">
  9.         <input name=ct type=hidden value="2097152">
  10.         <input name=si type=hidden value="miliol.com">
  11.         <input name=si type=hidden value="">
  12.         </form>
  13.     </div>
  14. </div>
  15. <div class="box-bottom">
  16.     <i class="lb"></i>
  17.     <i class="rb"></i>
  18. </div>

将其中红色的域名替换为自己的,之后进入小工具设置页面部将“主题小工具搜索”添加到适合的位置。

可惜不能像Google自定义搜索一样将搜索结果集成到主题中,只能在新窗口或标签中打开百度查看搜索结果,理论上应该可以,等俺再研究研究......

米粒在线
  • 本文由 发表于 2013年5月8日21:02:40
  • 转载请务必保留本文链接:https://www.miliol.org/7348.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: