Wordpress post_type =帖子不排除页面

时间:2014-09-15 01:27:47

标签: jquery wordpress

这是我的查询

Select
$queryStringKeyWords
as my_rate,
`wp_posts`.*
from `wp_posts`
WHERE `post_status` = 'publish' OR `post_status` = 'future'
AND `post_type` = 'post'
order by my_rate desc limit 0, 10

但我得到了回页。为什么?

2 个答案:

答案 0 :(得分:1)

尝试将括号放在你的位置

WHERE (`post_status` = 'publish' OR `post_status` = 'future')

在执行更复杂的事情(如组合WHERE OR ||)时的括号帮助AND OR

答案 1 :(得分:0)

尝试在查询中使用'而不是`

Select
$queryStringKeyWords
as my_rate,
'wp_posts'.*
from 'wp_posts'
WHERE 'post_status' = 'publish' OR 'post_status' = 'future'
AND 'post_type' = 'post'
order by my_rate desc limit 0, 10