<h1><?php the_category(' • '); ?> รยป <a href="<?php the_permalink(); ?>" class="my-title-class"><?php the_title(); ?></a></h1>
How to add class="my-category-class"
to the links, produces by the_category
function?
<h1><?php the_category(' • '); ?> รยป <a href="<?php the_permalink(); ?>" class="my-title-class"><?php the_title(); ?></a></h1>
How to add class="my-category-class"
to the links, produces by the_category
function?
You must be logged in to post a comment.
You can use
the_category
filter to hook a callback function like this:Pick your choice:
.post-categories a {YOUR_STYLE_HERE}
;$("link-categories a").addClass("my-category-class");
;As a beginner I would try creating my function, that I would call instead of the_category();
I believe this could be done more professionally, including all the variables, but I’d go this way for starters ๐