Styling Category names and category links inside the loop and single post
-
So I have searched and I haven’t found nothing yet, but I think it may be useful for many people..the function
<?php the_category('|'); ?>only allows template customization for the separators, but I want certain linked category names associated with the post, to have different styles than others on the same list (may be ordered or not.
See here: http://www.re-searcher.com/site/content/illustrators (please Nevermind the cluttering, it’s not close to be finished)I want to achieve this because my site has artists whose artwork should be divided and easily styled or ordered in different groups of categories(to say 4 different groups of clickable childs only) right bellow the contents of his Bio page / Blog post, but also excluding generic categories like “featured” or “portfolio”
So my problem is that I couldn’t find yet a plugin or a hack that can be able to add a custom order or style. in the_category function…
I’m not good at php, but my clue goes to the core code of WP (I’m not sure which file) that outputs the following html code:
<a rel="category tag" title="View all posts in CategoryX" href="http://www.website.com/blog/category/CategoryX">CategoryX</a>Changing to this on the front-end html(notice the caps):
<a rel="category tag" CLASS="CATEGORYID" title="View all posts in Category-X" href="http://www.website.com/blog/category/category-x">Category x</a>Given This possible, I could then style my category on my css based on its ID or class??
I know I can do this on the sidebar, but how is it possible inside the loop or the single post?
The topic ‘Styling Category names and category links inside the loop and single post’ is closed to new replies.