Check if a post has a specific Category
-
Hi, I want to check if a post has specific category. I used the in_category() function. I passed two argument, the category name and post ID. The problem is when I pass the post ID as a number (e.g. in_category(‘uncategorized’, 876)) it works. But when I pass it as id (e.g. post->ID ) I don’t get anything. Any suggestions?
- The topic ‘Check if a post has a specific Category’ is closed to new replies.