我已经定制了一个主题,并且在使用多词查询的搜索结果中遇到了一些问题。网站是住在www.abetterworldbydesign.com搜索结果不显示在WordPress中的多个词搜索
Searching for a single word按预期工作。
Searching for multiple words应该返回结果显示空白结果。
下面的searchform.php代码。
<form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>">
<div>
<input type="text" id="s" name="s" />
<input type="submit" id="searchsubmit" value="<?php esc_attr_e('Search', 'richwp'); ?>" />
</div>
</form>
我在search.php中代码初始化WP_Query如下正好the code listed in the codex。完整代码为search.php on pastebin。您搜索的PHP
也问在Wordpress的答案:http://wordpress.stackexchange.com/questions/24102/search-results-not-displaying-for-multiple-word-search –
为什么不给搜索权力的人 - 谷歌。示例查询“Zero Energy Usage site:www.abetterworldbydesign.com”:http://www.google.com/search?sclient=psy&hl=zh-CN&source=hp&q=Zero+Energy+Usage+site:www.abetterworldbydesign.com&pbx=1&oq =零+能量+用法+网站:www.abetterworldbydesign.com&aq = f&aqi =&bav = on.2,or.r_gc.r_pw。&biw = 1400&bih = 912 – Igor
@Igor - 用Google自定义搜索替换WordPress搜索将是解决方法我宁愿避免。主要缺点是要求在网站上使用Google品牌。 http://www.google.com/cse/docs/tos.html –