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.