- This topic has 7 replies, 2 voices, and was last updated 2 years, 1 month ago by Leo.
-
AuthorPosts
-
June 25, 2018 at 5:01 pm #608446Mel
I am needing help inserting category icons in WordPress. I am creating a website for a client that is mainly a blog and she wishes to have her categories labeled with custom icons. I am using a widget now that displays the posts on the homepage (screenshot is attached) and the icons that are currently showing are copy and pasted character icons. Is there a way to use custom icons or font-awesome icons for categories in WordPress? The current widget is “LiveMesh Add-ons” and has downloaded many plugins that allow for category icons but none will work on this widget.
June 25, 2018 at 8:25 pm #608536TomLead DeveloperLead DeveloperHi there,
Which plugins for category icons have you tried?
What’s the password to access the frontend of the site?
Thanks! π
June 25, 2018 at 8:32 pm #608542MelHi Tom! Thank you for your quick response, I’m really impressed!
I have tried all the plugins I could find, currently I’m using Easy Category Icons. If you go to categories you’ll see that I’ve uploaded images for the categories but they do not work. It only works if I paste in Unicode icons but that doesn’t really work from a design standpoint.
Is there some custom code I can put into GeneratePress to use FontAwesome instead?
Thanks Tom, I really appreciate your help. I love GeneratePress, I have build dozens of client sites using your theme and everyone is so happy with the result.
-Mel
June 25, 2018 at 8:44 pm #608552TomLead DeveloperLead DeveloperYou could try using your own CSS instead of a plugin.
For example:
1. Add Font Awesome to your site: https://docs.generatepress.com/article/font-awesome/
2. Find the body class of the category. For example, if I right click + Inspect the Diet and Herbs category, I see this class in the
<body>
element:category-diet-herbs
3. Find the
unicode
of the icon you want to use: https://fontawesome.com/icons/magic?style=solid3. Add the icon using CSS:
.category-diet-herbs .page-header h1:before { font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f0d0"; }
Or, you can use an image:
.category-diet-herbs .page-header h1:before { content: url(URL TO YOUR IMAGE); }
Hope this helps π
June 25, 2018 at 8:47 pm #608554MelThank you so much!! I will give this a try and see how it goes. Really appreciate it, Tom. π
June 25, 2018 at 8:50 pm #608556TomLead DeveloperLead DeveloperYou’re welcome π
February 25, 2022 at 4:22 pm #2133992KarissaHi! Could you also help me with this as well. I have my own SVG icons in the asset library of GenerateBlocks and I want to change the folders to my own custom SVG icon.
February 25, 2022 at 4:45 pm #2134005LeoStaffCustomer SupportCan you open a new topic for your question?
This one is very old.
Thanks!
-
AuthorPosts
- The topic ‘How to create custom category icons in WordPress’ is closed to new replies.