【関連記事設定-関連性=カテゴリ】 【表示中の・投稿ID=1234・カテゴリ=9】 【カスタム投稿 post_type=hogehoge/taxonomy=hoge_tag,hoge_cat】 ■やってみたこと 【cocoon-child-master/functions.php】に追記 function hoge_search_filter($query) { if (is_singular( 'hogehoge' ) ) { $query->set( 'post_type', array( 'post', 'hogehoge' ) ); } } add_action( 'pre_get_posts','hoge_search_filter' ); ■結果ダンプ 【cocoon-master/tmp/related-list.php】 1.$args = get_related_wp_query_args() 内容ダンプ (term_taxonomy/taxonomy='hoge_categories') ----------- 'post__not_in' => array 0 => int 1234 'posts_per_page' => int 5 'orderby' => string 'rand' 'no_found_rows' => boolean true 'date_query' => array 0 => array 'after' => string '2020-01-01 0:0:0' 'inclusive' => boolean true 'category__in' => array 0 => int 9 ----------- →これは合ってるぽい ※関連をカテゴリーで指定、その他指定内容も加味されている 2. $query = new WP_Query( $args ); 後に$query->query_varsダンプ ----------- 'post__not_in' => array 0 => int 1234 'posts_per_page' => int 5 'orderby' => string 'rand' 'no_found_rows' => boolean true 'date_query' => array 0 => array 'after' => string '2020-01-01 0:0:0' 'inclusive' => boolean true 'category__in' => array 0 => int 9 'error' => string '' 'm' => string '' 'p' => int 0 'post_parent' => string '' 'subpost' => string '' 'subpost_id' => string '' 'attachment' => string '' 'attachment_id' => int 0 'name' => string '' 'pagename' => string '' 'page_id' => int 0 'second' => string '' 'minute' => string '' 'hour' => string '' 'day' => int 0 'monthnum' => int 0 'year' => int 0 'w' => int 0 'category_name' => string '' 'tag' => string '' 'cat' => string '' 'tag_id' => string '' 'author' => string '' 'author_name' => string '' 'feed' => string '' 'tb' => string '' 'paged' => int 0 'meta_key' => string '' 'meta_value' => string '' 'preview' => string '' 's' => string '' 'sentence' => string '' 'title' => string '' 'fields' => string '' 'menu_order' => string '' 'embed' => string '' 'category__not_in' => array empty 'category__and' => array empty 'post__in' => array empty 'post_name__in' => array empty 'tag__in' => array empty 'tag__not_in' => array empty 'tag__and' => array empty 'tag_slug__in' => array empty 'tag_slug__and' => array empty 'post_parent__in' => array empty 'post_parent__not_in' => array empty 'author__in' => array empty 'author__not_in' => array empty 'post_type' => array 0 => string 'post' 1 => string 'hogehoge' 'ignore_sticky_posts' => boolean false 'suppress_filters' => boolean false 'cache_results' => boolean true 'update_post_term_cache' => boolean true 'lazy_load_term_meta' => boolean true 'update_post_meta_cache' => boolean true 'nopaging' => boolean false 'comments_per_page' => string '50' 'order' => string '' ----------- →これも合ってるような気がする 3. $query->requestダンプ ----------- SELECT posts.ID FROM posts WHERE 1=1 AND ( posts.post_date >= '2020-01-01 00:00:00' ) AND posts.ID NOT IN (1234) AND ( 0 = 1 ) AND posts.post_type IN ('post', 'hogehoge') AND (posts.post_status = 'publish' OR posts.post_author = 1 AND posts.post_status = 'private') GROUP BY posts.ID ORDER BY RAND() LIMIT 0, 5 ----------- →なにか色々違うぞ ・0 = 1:[category__in]が上手く翻訳できなかった? 何卒宜しくお願い致します。