Using in_category() with category name, not ID
-
Hi,
How do I test whether a post in the loop is in a particular named category? I know I can use, say,
in_category(6)
if I know the category ID, but what if I only know the category name? I’d like to usein_category("catname")
.One solution might be to get the category ID from the category name. Is there a simple way to do that?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Using in_category() with category name, not ID’ is closed to new replies.