【发布时间】:2013-07-23 04:51:43
【问题描述】:
WordPress 3.5.2。 像
这样的老建筑?tag=tag1+tag2
不再起作用了。我不知道为什么。 我有一个带有复选框的表格。以及按类别排序的标签。 所以我想搜索
tag1+tag2+tag3
在特定类别中。 怎么做? 我很累寻找解决方案:(
【问题讨论】:
WordPress 3.5.2。 像
这样的老建筑?tag=tag1+tag2
不再起作用了。我不知道为什么。 我有一个带有复选框的表格。以及按类别排序的标签。 所以我想搜索
tag1+tag2+tag3
在特定类别中。 怎么做? 我很累寻找解决方案:(
【问题讨论】:
逗号分隔它们:
/** posts with any of the following tags */
$query = new WP_Query( 'tag=bread,baking' );
/** posts with all of the following tags */
$query = new WP_Query( 'tag=bread+baking+recipe' );
/** or alternatively */
$query = new WP_Query( array( 'tag_slug__in' => array( 'bread', 'baking' ) ) );
【讨论】: