am excluding comments from specific categories. However, when I try to exclude more than one, it doesn’t work.
This works: <?php if (!in_category('7')) comments_template(); ?>
This does not work:
<?php if (!in_category('7 , 9')) comments_template(); ?>
or
<?php if (!in_category('7')) comments_template(); ?> <?php if (!in_category('9')) comments_template(); ?>
WordPress has a pretty decent documentation that is always worth looking into first. See Function Reference: in_category()
The function does not seem to accept multiple arguments, so you’ll have to do this in PHP: