Title: Sometimes CSS not loading
Last modified: September 1, 2016

---

# Sometimes CSS not loading

 *  Resolved [David @roundrobined](https://wordpress.org/support/users/dvdscr/)
 * (@dvdscr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/)
 * Hi,
    I’ve the following problem. My WP site sometimes don’t load correclty the
   CSS, infact in Apache log, when the problem occurs, two lines don’t appears:
 *     ```
       [14/Jun/2016:15:18:27 +0200] "GET /wp-includes/css/dashicons.min.css,qver=4.4.pagespeed.ce.X2cvQ4DGDW.css HTTP/1.1" 304 -
       [14/Jun/2016:15:18:27 +0200] "GET /wp-includes/css/admin-bar.min.css,qver=4.4.pagespeed.ce.IzXC0ivIXx.css HTTP/1.1" 304 -
       [14/Jun/2016:15:18:27 +0200] "GET /wp-content/themes/mineral/css/A.prettyPhoto.css,qver=1.5.4.pagespeed.cf.hwHBzDR-Sf.css HTTP/1.1" 304 -
       ```
   
 * Normally, when it works correctly, the log shows:
 *     ```
       [14/Jun/2016:15:21:06 +0200] "GET /wp-includes/css/dashicons.min.css,qver=4.4.pagespeed.ce.X2cvQ4DGDW.css HTTP/1.1" 304 -
       [14/Jun/2016:15:21:06 +0200] "GET /wp-includes/css/admin-bar.min.css,qver=4.4.pagespeed.ce.IzXC0ivIXx.css HTTP/1.1" 304 -
       [14/Jun/2016:15:21:06 +0200] "GET /wp-content/themes/mineral/css/A.prettyPhoto.css,qver=1.5.4.pagespeed.cf.hwHBzDR-Sf.css HTTP/1.1" 304 -
       [14/Jun/2016:15:21:06 +0200] "GET /wp-content/themes/mineral_child/style.css?ver=1.5.4 HTTP/1.1" 200 215
       [14/Jun/2016:15:21:06 +0200] "GET /wp-content/themes/mineral/style.css HTTP/1.1" 200 21432
       ```
   
 * How can I understand where is the problem?
 * Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475520)
 * Without seeing the code first hand it appears to me that your child theme is 
   not calling the CSS style sheets correctly.
 *  Thread Starter [David @roundrobined](https://wordpress.org/support/users/dvdscr/)
 * (@dvdscr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475556)
 * Hi,
    thanks for your reply. I don’t think it is a problem of the child theme,
   but I can try to disable it, because in the first case (when the error occurs)
   there are not GETs about the style.css files. I mean that it not fails, simply
   the GET don’t appear. I don’t understand why in this case I can see in the log
   the style.css files.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475596)
 * I was not suggesting you disable the child theme. I was suggesting that there
   are import statements like this one missing from the child themes css.
 * `@import url("../themify-ultra/style.css");`
 * You need be sure that you have all the import statements in your child themes
   CSS. If any are missing that is why it does not load consistently.
 *  [ProjectArmy](https://wordpress.org/support/users/supporthero/)
 * (@supporthero)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475600)
 * Doing an `@import` is no longer a good practice according to the codex.
 * Please see [this guide](https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme).
 * Quoted from the codex:
 * The final step is to enqueue the parent and child theme stylesheets. Note that
   the previous method was to import the parent theme stylesheet using [@import](https://wordpress.org/support/users/import/):
   this is no longer best practice, as it increases the amount of time it takes 
   style sheets to load. The correct method of enqueuing the parent theme stylesheet
   is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child
   theme’s functions.php
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475602)
 * [@supporthero](https://wordpress.org/support/users/supporthero/), when was this
   change made? I have been working with WP for ten years and as recently as December
   2015 I had checked and `@import` was still mentioned in the codex so I have been
   sticking with that.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475603)
 * [@dvdscr](https://wordpress.org/support/users/dvdscr/), My point still stands,
   maybe you have not enqueued all styles and scripts in the child theme and that
   is why it is not loading correctly or loads correctly on an inconsistent basis.
 *  [ProjectArmy](https://wordpress.org/support/users/supporthero/)
 * (@supporthero)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475605)
 * I think it was updated in 2014. The codex reference that I linked has additional
   references in the bottom. Here’s the [reference](https://kovshenin.com/2014/child-themes-import/)
   as to why [@import](https://wordpress.org/support/users/import/) is not a good
   idea.
 * Anyway, I’m not here to argue. I just want to share what I know based from the
   WordPress bible which is the codex. If you want to enqueue styles and scripts,
   the codex recommends that you do it in functions.php.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475606)
 * [@supporthero](https://wordpress.org/support/users/supporthero/), I am not here
   to argue either. I was simply asking a question! Maybe I had the page cached 
   locally or something weird like that. Whatever, thank you for bringing this to
   my intention.
 *  Thread Starter [David @roundrobined](https://wordpress.org/support/users/dvdscr/)
 * (@dvdscr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475649)
 * [@binarywc](https://wordpress.org/support/users/binarywc/), [@supporthero](https://wordpress.org/support/users/supporthero/),
   thanks for your answers.
    The problem probably is [@import](https://wordpress.org/support/users/import/).
   In fact if I disable child theme or if I disable pagespeed apache module with
   child theme enabled, it works correctly. Probably pagespeed module sometimes 
   not allows to charge the imported CSS in time. Now I can try to remove [@import](https://wordpress.org/support/users/import/)
   and to renable pagespeed module.
 * I test it and I tell you.
    David
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475650)
 * We are always glad to help! Thats what the support community is here for!
 *  Thread Starter [David @roundrobined](https://wordpress.org/support/users/dvdscr/)
 * (@dvdscr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475657)
 * Hi,
    I’ve finally solved. Disabling “pagespeed” module, it works. Anyway, I enable
   it again, because the problem is between the “speed” and the [@import](https://wordpress.org/support/users/import/)
   code in CSS file.
 * Thanks a lot,
    David

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Sometimes CSS not loading’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)
 * [sheet](https://wordpress.org/support/topic-tag/sheet/)
 * [style](https://wordpress.org/support/topic-tag/style/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 3 participants
 * Last reply from: [David @roundrobined](https://wordpress.org/support/users/dvdscr/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/sometimes-css-not-loading/#post-7475657)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
