Skip to content

Commit

Permalink
除外カテゴリーを指定したが、投稿の関連記事に、除外したカテゴリーが表示される不具合修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed Dec 31, 2023
1 parent 63b347c commit 5e771aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/related-entries.php
Expand Up @@ -122,6 +122,14 @@ function get_additional_related_wp_query_args($args) {
}
}

//除外カテゴリーの処理を追加
$exclude_category_ids = get_archive_exclude_category_ids();
if ($exclude_category_ids && is_array($exclude_category_ids)) {
$args += array(
'category__not_in' => $exclude_category_ids,
);
}

return apply_filters('get_additional_related_wp_query_args', $args);
}
endif;
Expand Down

0 comments on commit 5e771aa

Please sign in to comment.