239 posts
  • Sold between 5 000 and 10 000 dollars
  • Bought between 1 and 9 items
  • Envato Studio (Microlancer) Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
  • Exclusive Author
  • Has been a member for 1-2 years
Patchesoft says

Howdy! I am trying to style the default WordPress widgets that use lists such as New Comments and Archives and Categories. I want to use the Bootstrap icons for the list items and I was wondering how I go about doing this?

I can target the lists using #widget ul li {} but how do I apply the icons to the list from the Bootstrap settings. The icons have class names like icon-comment and to use them you have to use:

<i class="icon-comment" />

Is there a way to apply the icons to the list elements? I could recreate the widgets and insert the icons like that, but that doesn’t seem the most efficient way. Any help?

707 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
ChillThemes says

If it was an icon font you could use :before pseudo-element to do that.

239 posts
  • Sold between 5 000 and 10 000 dollars
  • Bought between 1 and 9 items
  • Envato Studio (Microlancer) Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
  • Exclusive Author
  • Has been a member for 1-2 years
Patchesoft says

Ah yeah that doesn’t work. I tried

.main-sidebar-widget li:before { content: "<i class="icon-search" />"; }

And all it will output is the text XP

707 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
ChillThemes says

Of course that won’t work, would be nice if it were that simple. You have to use character codes, for example:

content: "\00d7";

You would have to buy Glyphicons pro to get access to the icon font, or use font-awesome.

A Whole Bunch of Amazing Stuff Pseudo Elements Can Do

by
by
by
by
by
by