290 posts
  • Has sold $10,000+ on Envato Market
  • Joined an Envato Football competition
  • Has been a beta tester for an Envato feature
  • Located in United Kingdom
+4 more
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?

709 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+2 more
ChillThemes says

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

290 posts
  • Has sold $10,000+ on Envato Market
  • Joined an Envato Football competition
  • Has been a beta tester for an Envato feature
  • Located in United Kingdom
+4 more
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

709 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+2 more
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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by