I was looking for some kind of code that changed the class of a certain div or span depending on the category of the post.
I’ve searched the forum (and on google) and I think I’ve found what I’m looking for, but, for some reason, that I’m not aware of, the “thing” isn’t working.
What I’ve tried to use were these two…
It’s almost the same thing, however the first one will return the default class for the posts instead of a special class for a specific category, which is better for me, since I don’t have to create a new category to the default posts.
What I want to do is this: I want to change the “mrc” (in the link below) to “category1class” or “category2class” depending on the category of the post.
And what I do is this…
So, why is not working? Am I doing something wrong?
- The topic ‘Different class for each category’ is closed to new replies.