meriadoctookme
Member
Posted 3 years ago #
Hello!
I have a question regarding my tags and/or category links. I have my tags in a list and would like certain tags to have particular colours. Like, make "blog" tags have a green background and right below, when the "news" tag is used it has a different colour.
I say tags and/or cats because I'm still deciding hich to list this way. Whichever is easiest, really.
You'd have to create your own loops to display the categories or tags. For tags, for example, you could use get_the_tags();
See http://codex.wordpress.org/Template_Tags/get_the_tags
And then when you loop through the tags, you can set up a conditional statement which gives certain tags certain CSS classes.
For categories, you can do the same with get_the_category();
See http://codex.wordpress.org/Template_Tags/get_the_category
meriadoctookme
Member
Posted 3 years ago #
Okay, so how would I do that? What conditional statement would work, if I wanted each tag to have a different background colour?
I don't know much php to be honest.