Title: using &quot;wp_enqueue_scripts&quot; instead of &quot;@import&quot;
Last modified: August 22, 2016

---

# using "wp_enqueue_scripts" instead of "@import"

 *  [pro100tom](https://wordpress.org/support/users/pro100tom/)
 * (@pro100tom)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_scripts-instead-of-import/)
 * Hello, guys. I am very new to WordPress yet. It is said [here](http://codex.wordpress.org/Child_Themes)
   that when you use child theme you need to create two files: style.css and functions.
   php. The second one is needed in order to execute this code:
 *     ```
       <?php
       add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
       function enqueue_child_theme_styles() {
           wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
           wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style')  );
       } ?>
       ```
   
 * It is responsible for importing the parent stylesheet into the child theme instead
   of using `@import url("../twentyten/style.css");` (in style.css).
 * I have a theme called [Salient](http://themeforest.net/item/salient-responsive-multipurpose-theme/4363266)
   and I have made a “salient-child” directory within the “wp_content/themes/” one
   just right next to the original “salient” directory. In that “salient-child” 
   directory I have created a style.css file and inserted this:
 *     ```
       /*
        Theme Name:   Salient Child
        Theme URI:    http://themeforest.net/item/salient-responsive-multipurpose-theme/4363266/
        Description:  An Ultra Responsive Multi-Purpose Theme.
        Author:       Tomas Baranauskas
        Author URI:   none yet
        Template:     salient
        Version:      4.0.1
        Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
        Text Domain:  salient-child
       */
       ```
   
 * In my “functions.php” I have inserted the code (I pasted it in the beginning 
   of this thread already). Two problems appear:
    1. When I press F12 in Chrome browser (Windows 8.1) I see 9 errors, one of which
       looks like this:
    2. > GET [http://localhost/wp-content/themes/salient-child/css/fonts/OpenSans-Regular-webfont.woff](http://localhost/wp-content/themes/salient-child/css/fonts/OpenSans-Regular-webfont.woff)
    3. If you need all of them I will post them later.
    4. The second issue is that responsive layout is not working correctly anymore 
       and everything messes up.
 * When I paste the “css” folder with fonts and files from my parent theme into 
   my child one – errors are gone, however responsive layout still does not work.
   
   If I delete “functions.php” from my child theme, then responsive layout works
   fine, but if I paste any file from parent theme into the child one in order to
   be able to customize the theme, then WordPress doesn’t look for the files in 
   child theme at all, goes straight to the parent one. If I don’t delete “function.
   php” from my child theme then I don’t see some of the “css” in Chrome styles 
   tab at all. I didn’t test importing files using “@import” yet.
 * Firstly I would like to know why it is not recommended to use “@import” in “style.
   css” and why my “functions.php” in child theme messes up the whole stuff. Also
   I would like to know why console errors occur if I do not copy the “css/fonts”
   directories from the parent theme to the child one. And finally help me please
   by telling what’s wrong with my “functions.php” and how to make it work right.
   Thank you very much!

The topic ‘using "wp_enqueue_scripts" instead of "@import"’ is closed to new replies.

## Tags

 * [child](https://wordpress.org/support/topic-tag/child/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)
 * [style](https://wordpress.org/support/topic-tag/style/)
 * [wp_enqueue_scripts](https://wordpress.org/support/topic-tag/wp_enqueue_scripts/)

 * 0 replies
 * 1 participant
 * Last reply from: [pro100tom](https://wordpress.org/support/users/pro100tom/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_scripts-instead-of-import/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
