我创建一个名为 type 的分类法,该分类法包含3个术语-主题,插件,托管。每个分类法都有几个职位。我想在单个页面上显示特定的相关帖子。
示例1:当访客阅读“ Avada主题评论”时,我想显示“ 主题”一词中的帖子 示例2:当访客阅读“ Visual Composer评论”时,我想显示“ 插件”一词的帖子
我的查询是:
global $post;
$categories = get_the_category( $post->ID );
$term_ids = array();
foreach( $categories as $individual_field ) {
$term_ids[] = $individual_field->term_id;
}
$args = array(
'post_type' => $post_type,
'posts_per_page' => $posts_per_page,
'category__in' => $term_ids,
'post__not_in' => array( $post->ID ),
);
我该如何更新?
请帮助...