/    Sign up×
Community /Pin to ProfileBookmark

Display icon per value in custom taxonomy in WordPress

I have created custom post types in a WordPress installation, and there are 3 sets of custom taxonomy with that. I’d like to be able to assign and icon to each of the values in those taxonomies to display along with the value name in posts.

I am using Beaver Builder and so I am able to create a Themer layout template for the custom post types and can pull the custom taxonomies (along with some Advanced Custom Fields) into the layout. The value text displays, but not an icon.

So for example, if I had a taxonomy that was difficulty, and values of easy, difficult, super hard. Then I would want to associate an icon with each of those and then display it in the layout along with the value (i.e. “easy”). I can see that it may be possible to place the icon in the taxonomy value description, or create a ACF field to associate with the taxonomies… but how to display it?

I’m looking into using ::before and CSS, but haven’t quite nailed the code.

Thoughts? Advice?

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @uxmonkey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...