Theme broken after upgrading to WordPress 4.5, missing stylesheet?

Updating to WordPress 4.5 broke my theme, ThemeWoot Emulate. It appears that perhaps a stylesheet is somehow missing. Example symptoms:

  • The mobile menu is shown by default
  • The top search box is being shown by default
  • The contact form modal is being shown by default
  • Various links are underlined and a different font

One thing I noticed was that, in the case where sections should be hidden by default, a .hide class is present, but there is no corresponding style being applied to that class.

I tried clearing the server and browser cache. I’ve tried deactivating all plugins and updating them, but there’s no difference.

2 Answers
2

It turns out that the ThemeWoot Emulate theme registers and enqueues a common.css file with the key of common in it’s themewoot.php (which is being included in functions.php).

This key is apparently conflicting with a wp-admin script being registered with the same common key, and so, instead of including Emulate’s common.css, it’s enqueuing and injecting the wp-admin common.min.css.

I edited the themewoot.php and namespaced the common key with a an emulate- prefix:

From:

wp_register_style('common', $this->theme_url(). '/css/common.css', false, TWOOT_VERSION, 'all');

wp_enqueue_style('common');

To:

wp_register_style('emulate-common', $this->theme_url(). '/css/common.css', false, TWOOT_VERSION, 'all');

wp_enqueue_style('emulate-common');

And that got things back in working order.

ThemeWoot doesn’t appear to be maintaining the Emulate theme anymore. In reality they should patch this and provide an update.

<rant>
WordPress should seriously consider namespacing their core styles and scripts so that updates don’t affect themes like this. A simple wp- would have gone a long way here and saved me at least a few hours. Theme creators should also namespace all of their assets too so that they play nice with everything else.
</rant>

Leave a Comment