我想从特定类别或特定用户发布帖子。看来我们在wordpress中只能有AND条件。我知道下面的代码是错误的,但是这是我需要得到 - 我希望所有由特定用户编写的帖子或从一个特定的类别按类别或作者获取文章wordpress
$args = array(
'posts_per_page' => 10,
'offset' => $PageStart,
'query' => array(
'relation' => 'OR', /* <-- here */
array(
'author' => 18,
),
array(
'category' => 20,
)
),
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
);
//print_r($args);
$author_post = get_posts($args);
请你帮助所有的职位。提前致谢 。
这将调用'AND'他不想再想要.. –