hayfordoleary
Member
Posted 3 years ago #
I'm looking to have my template customised if it's affiliated with a certain category. I know that I can use is_category() for the archive of the category, but I don't know how to (or if I can) do anything to a post within the category.
Just to be clear, an example post is "Billy's Bike Store" under the category "Local Businesses", category ID 10. So is there some way to say, if the parent category ID is "10", print {text}?
(I'm running WP 2.0, if it makes a difference)
Yes, there defeinately is. Check out this thread. My method is to define a different CSS class for every category I want affected, but you can go deeper down that rabbit hole if you like.
Yes, that also would work. The first method would be if you were having all the different posts on the same page, the second on their individual post and category pages.
Well, the title of the topic asks for "custom template for single within a category". The plugin does exactly that.
Single means one post, not "different posts on the same page".
Yes, it does — fair enough. I'm just a little post-happy for something I think I know how to explain.
(better luck next time...)