Search Suggest 插件wordpress搜索推荐
当您就WordPress的博客的东西搜索时没有任何结果受挫后你肯定会很苦恼,因为没有要的东西出来,你在瞎琢磨是不是犯了一个拼写错误?或者有太多的可能,而且您又有点想重新搜索,但又不知道该怎么做?
搜索推荐
当您就WordPress的博客的东西搜索时受挫后你肯定会很苦恼,因为没有结果出来,你在瞎琢磨是不是犯了一个拼写错误?或有太多的搜索结果,而且您有点不得不重新搜索,但又不知道该怎么做?
搜索建议提供帮助在这两种情况下。使用Yahoo ! API的拼写纠错和相关的搜索,检索和显示这些给您和您的用户。不再将人为的搜索,但又毫无结果“ WordPess插件”或其他拼写错误的原因造成的。
它相当容易,在上载和激活插件,请打开search.php文件,下面的“没有发现搜索结果”的消息后面,加上这这一句:
<?php if ( function_exists('spell_suggest') ) { spell_suggest(); } ?>
如果你想查看相关的搜索,只需再添加如下一行:
<?php if ( function_exists('related_searches') ) { related_searches(); } ?>
以下是原帖:
Search Suggest
Don't you hate it when you search for something on a WordPress blog, and only after being frustrated for a bit there there's no results, you realize that you've made a spelling error? Or that there's too many results and that you'd rather refine your search a bit, but don't know to what?
Search Suggest offers help in both cases. Using the Yahoo! API for spelling and related searches, it retrieves those and shows them to you and your users. No longer will people search in vain for "WordPess plugins" or other typo's.
It works fairly easy, after uploading and enabling the plugin, open up your search.php file, and below the "no posts found" message, add this:
<?php if ( function_exists('spell_suggest') ) { spell_suggest(); } ?>
And if you want to show related searches, just add the following:
<?php if ( function_exists('related_searches') ) { related_searches(); } ?>