Archived topic
FontAwesome icon for "posted on" entry meta
3 replies · Started by Luca on November 11, 2016
Hi,
What would be the best way to add a fontawesome icon to the posted on meta WITHOUT using the :before pseudo-element in CSS but rather adding the actual <i> code? The key reason for doing that vs. CSS would be to be able to define that as aria-hidden.
Thanks,
Luca
Hi Luca,
You would have to overwrite the generate_entry_meta() function by copying the entire function into your child theme/custom plugin: https://github.com/tomusborne/GeneratePress/blob/1.3.40/inc/template-tags.php#L217-L251
Let me know if you need more info :)
Ok thanks.
However, for the future would you give some thought to consider inserting the FA icons (see also the tags and categories icons in blog posts) using the <i> tags rather than the :before pseudoclass as using the <i> tag with ARIA syntax improves accessibility and is the suggested way by their own guidelines: http://fontawesome.io/accessibility/
Just saying....
Cheers,
Luca
I'll definitely look into it - thank you! :)