【发布时间】:2019-05-21 17:03:01
【问题描述】:
创建一个新帖子并发布它。
标题为my test for search,内容如下:
no host route
检查 wordpress 数据库中发生的情况。
select post_title from wp_posts
where post_content like "%no%"
and post_content like "%route%"
and post_content like "%to%"
and post_content like "%host%";
名为my test for search 的帖子不会出现在选择结果中。
在 wordpress 搜索栏中输入no route to host,然后点击回车。
名为my test for search 的帖子显示为结果。
我找到了网页包含to的原因,在左上角,有一个单词Customize,其中包含搜索到的单词to。
如何在 wordpress 搜索栏中更改此类搜索操作?
我想让wordpress saerch bar中的搜索行为,例如,当你输入no route to host时,等于下面的sql命令。
select post_title from wp_posts where post_content like "%no%route%to%host%";
我wordpress中的所有插件。
CodePen Embedded Pens Shortcode
Crayon Syntax Highlighter
Disable Google Fonts
Quotmarks Replacer
SyntaxHighlighter Evolved
【问题讨论】:
-
请提供
SHOW CREATE TABLE wp_posts。我怀疑整理。 -
您的搜索查询不是由默认 WP 安装生成的。看起来你已经修改了它。搜索支持 GET 参数,如句子和精确,但它们不会生成您想要的
post_content like "%no%route%to%host%";。您能否进一步扩展为什么自定义标签会影响您的搜索,它应该与搜索完全无关。