I need to add an empty span ( <span></span>
) inside each post category link just before the text, it doesn't appear to have a data-markup-id. Please see below for example:
<span class="uk-text-small uk-text-muted uk-clearfix" data-markup-id="beans_post_meta_categories"><a href="http://domain.com/category" rel="category tag"><span></span>Category 1</a></span>
My purpose for doing this is so I can make the entire containing div clickable whilst using the category url.
Any help / ideas on how this could be achieved would be great.
If you want to make the whole container clickable, use a block level link from the UIKit included in Beans.
KEEP IN MIND: Beans uses UIkit V2, NOT V3.
Hi Jasper,
Thanks for your response, I would try what you suggested and add the uk-position-cover to my link however, it doesn't contain a data-markup-id. The parent element does, which is beans_post_meta_categories but inside that is a link, with no id.
So do you know how I could modify the link attribute?
Cheers,
Hayden
Hey @haydz0r,
- The markup that contains the ID is built using Markup API.
- The category list is generated by WordPress function
get_the_category_list()
.
Inspect the function to see if any filter can help you to do that: https://developer.wordpress.org/reference/functions/get_the_category_list/
Note: This function may print more than one category.