wordpress - Show posts from two specific category in WP_Query
问题描述
I've two category employee and full-time. If a post publish in both (employee and full-time) category then the post will show in his specific section. If post has only employee category, not full-time or has only full-time, not employee, then this post will not show in the post block.
How can I do this? What will be the query of this relationship between two category??
Here is my code -
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array('employee', 'full-time'),
)
)
解决方案
推荐阅读
- c# - 如何使用 c# 运行 sqlite3 内联命令?
- asp.net-mvc - 使用分页符在单个 Word 文档中导出多个 MVC 视图
- javascript - Angular js在数组对象中使用ng-repeat设置默认选项卡
- reactjs - 使用 React JS CDN 并发布到产品问题
- python - 无论前面的字符串如何,如何计算特定单词(不是字符串)的频率?
- node.js - TypeScript 中的“TypeError:require(...) 不是构造函数”
- javascript - 从中检索数据
- 一个
- 在木偶戏
- 一个
- android - 重新安装已卸载的应用程序后如何取回下载数据
- python - QPlainTextEdit 检查某些条件
- javascript - 出现路径错误时如何选择复选框。我在柏树做这个