我正在尝试使用标签在我的网站上显示相关内容。我的帖子有多个链接到相似内容的标签。
在对帖子运行查询时,我希望忽略某些标记。这个是可能的吗?
例如:
Post-A有3个标签,Tag-1,Tag-2和Tag-3
Post-B有5个标签,Tag-1、Tag-2、Tag-4、Tag-5和Tag-6
对于我的查询,我要求始终忽略Tag-1和Tag-2。
我的理想结果是;
Post-A显示Tag-3,Post-B显示Tag-4、Tag-5和Tag-6
发布于 2014-06-04 20:38:41
use this wp query . I hope it will work for you.
$the_query = new WP_Query( array( 'tag__not_in' => array( 10 ) ) );
while ( $the_query->have_posts() ) : $the_query->the_post();
endwhile;https://stackoverflow.com/questions/24037374
复制相似问题