I want to apply a different layout to one category of post. I’ve been looking at the category functions, and I’m not sure what’s the easiest way to test, “Is this post of category X?”
the_category_ID is always returning 0, so I don’t know if I’m using it wrong.
<?php the_category_ID() ?>always prints 0
Unless someone suggests a better way, I’m going to try writing my own function for this, which will use get_the_category() and test to see if a certain category is returned in the results.
- The topic ‘category functions’ is closed to new replies.