Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Katherine Elsken
Katherine Elsken
2,330 Points

I can't get my icomoon icon fonts to work in my wordpress theme

so icomoon by default, upon downloading your icons, you get all the files plus a separate css file. It works just fine when I link it to a static html site, but when I try to translate it into a wordpress template, it doesn't load.

Has anyone had any luck with icomoon icons in wordpress?

4 Answers

Kevin Korte
Kevin Korte
28,149 Points

I have. Did you put your icomoon font files in a font folder in your theme? Usually the probable is the URLs in the CSS file icomoon gives you won't match exactly what you have.

What is your file structure looking like, and what are the URLs to match these font files in the CSS looking like.

I believe I always had to edit the font file URLs in the CSS to get it to work.

Katherine Elsken
Katherine Elsken
2,330 Points

I put the font stylesheet along with the font files in their own fonts folder. so in the css, I didn't have to source any other directories. I've tried moving the stylesheet and changing the directories, and I've even tried to combine the fonts css into my main stylesheet, but the font files have always stayed in the fonts folder

Katherine Elsken
Katherine Elsken
2,330 Points

I've tried linking the files by trying "../directory" and "/../directory" and I get nothing. What's interesting though is that if I copy the css for my icons and put it into my main stylesheet file, rather than having nothing there it'll put a rectangle character in it's place. but no icon D: It also turns out my enqueue styles function is only sourcing my main stylesheet and wont list any others. PHP just never wants to play nice does it?

Katherine Elsken
Katherine Elsken
2,330 Points

UPDATE:I figured it out!! the main issue was that I was using the same handle on both my scripts in the enqueue function. It's all working fine now!!