WordPress, Genericons, Jetpack and you

Here’s something I learned the hard way today.

If you are using Genericons in your WordPress theme, and you’re enqueueing it like this:

wp_register_style('genericons',get_template_directory_uri().'/genericons/genericons.css',false,$theme['Version']);
wp_enqueue_style( 'genericons' );

…you’re going to run into problems if Jetpack is enabled, because Jetpack uses the same method. Normally this wouldn’t be that much of an issue, but their version of the Genericons font is older and doesn’t include some of the newer icons — which will just be missing if you’re using the Jetpack version. So, to resolve this, you’ll need to make your Genericons handle more unique, e.g.

wp_register_style('mytheme-genericons',get_template_directory_uri().'/genericons/genericons.css',false,$theme['Version']);
wp_enqueue_style( 'mytheme-genericons' );

Update

This has officially been fixed and will be resolved in the next Jetpack release. There’s also a discussion over here about possibly including Genericons in core, which I wholeheartedly support. Thanks George and Jeremy for being so on top of things that they happened to notice my little blog post out in the middle of Nowhere, Blogosphere USA.

7 Comments

Jeremy
Jeremy(jeremyherve.com)

Hey there!

Are you having the issue with the latest version of Jetpack? We updated Genericons in Jetpack 3 weeks ago, so I believe it should now include all the new icons:
http://plugins.trac.wordpress.org/changeset/739986

Let me know if some of the icons are still missing, I’ll be happy to add them to Jetpack!

chris reynolds
chris reynoldsAuthor

Yep; 2.3.3. Specifically it was the cart icon that I was trying to use that was missing which is labelled as “new” on the Genericons page. @Krogsgard mentioned on twitter that he had this problem as well. I’m guessing the font file(s) might need to be updated.

chris reynolds
chris reynoldsAuthor

That would be awesome. I’ll definitely head over there to put in my $0.02. :)

Jeremy
Jeremy(jeremyherve.com)

Thanks! I’ll make sure we update it for the next Jetpack release.

Jeremy
Jeremy(jeremyherve.com)

Done. George was faster than me, and updated the Genericons in this changeset. The change will be included in the next Jetpack release.

Leave a Reply

Fields marked with an asterisk are required. Your email address will not be published.