CSS files are loading in the wrong order
-
I’m seeing a lot of CSS issues on the bug reports, and I’m having them too after doing an upgrade.
The following is from the source of one of the pages. Does the order of loading files not seem a little backwards to you? (the code was edited so it would post):
link rel='stylesheet' id='parallaxcss-css' href='http//example.com/wp-content/themes/evolve/library/media/js/parallax/parallax.css?ver=4.7.2' type='text/css' media='all' / link rel='stylesheet' id='fontawesomecss-css' href='http//example.com/wp-content/themes/evolve/assets/fonts/fontawesome/css/font-awesome.css?ver=4.7.2' type='text/css' media='all' / link rel='stylesheet' id='maincss-css' href='http//example.com/wp-content/themes/evolve/style.css?ver=4.7.2' type='text/css' media='all' / link rel='stylesheet' id='reset-css' href='http//example.com/wp-content/themes/evolve/assets/css/reset.css?ver=4.7.2' type='text/css' media='all' / link rel='stylesheet' id='bootstrapcss-css' href='http//example.com/wp-content/themes/evolve/assets/css/bootstrap.css?ver=4.7.2' type='text/css' media='all' / link rel='stylesheet' id='bootstrapcsstheme-css' href='http//example.com/wp-content/themes/evolve/assets/css/bootstrap-theme.css?ver=4.7.2' type='text/css' media='all' /
The
reset.css
should always be loaded before the other CSS. It is likely removing a lot of the stuff that is being done in the main style sheet.I think the problem is in this and related lines:
wp_enqueue_style('reset', get_template_directory_uri() . '/assets/css/reset.css', array('maincss'));
You’re forcing reset to load after maincss.
As an aside, there is also an enormous amount of CSS in the html page code. I understand that you may want some overrides there, but this is overkill.
- The topic ‘CSS files are loading in the wrong order’ is closed to new replies.