I have added some custom text at the end of all my articles. Now I want to remove that text if is in a certain category.
For that, I have the following code.
<?php if(in_category('sample-category')) : ?> <?php else: ?>
(this means I will NOT show my custom text at the end of articles posted in "sample-category") and it works perfectly.
Now I want to do this with 2 or more categories. I have tried anything I know/found but without results, like:
<?php if(in_category('sample-category', 'new-category')) : ?>
Tried by category name, category ID, category slug, but nothing works.
What can I do to exclude the custom text I have added to each single post on 2 or more categories?