Load CSS later on wp_head
-
simple-css loads its custom styles at wp_head:10:
add_action( 'wp_head', 'simple_css_generate' );
(10 is the default priority.)
This causes race conditions when plugins or themes load inline styles with the same priority, so that sometimes the custom styles override, and sometimes they don’t. I saw this issue specifically with the Arras theme, but there are lots of plugins that load stuff at wp_head, so I’m sure it’s a more common issue.
Anyway, I’d suggest that simple-css styles should always be among the last to load. For my client site, I’ve done the following:
add_action( 'plugins_loaded', function() { remove_action( 'wp_head', 'simple_css_generate' ); add_action( 'wp_head', 'simple_css_generate', 999999 ); } );
For the plugin, I would suggest moving to a higher priority:
add_action( 'wp_head', 'simple_css_generate', 999 );
- The topic ‘Load CSS later on wp_head’ is closed to new replies.