Title: function.php adding style-mobile.css child theme
Last modified: October 30, 2017

---

# function.php adding style-mobile.css child theme

 *  [marcinstanczak](https://wordpress.org/support/users/marcinstanczak/)
 * (@marcinstanczak)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/function-php-adding-style-mobile-css-child-theme/)
 * Hello, I have a problem with style-mobile.css it doesnt load 🙁
    I dont know 
   how to make it, maybe someone will help me. I use plugin to create child theme
   and I have function.php like that:
 *     ```
       <?php
       // Exit if accessed directly
       if ( !defined( 'ABSPATH' ) ) exit;
   
       // BEGIN ENQUEUE PARENT ACTION
       // AUTO GENERATED - Do not modify or remove comment markers above or below:
   
       if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
           function chld_thm_cfg_parent_css() {
               wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'tmnf-custom-style' ) );
           }
       endif;
       add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
   
       // END ENQUEUE PARENT ACTION
       ```
   
 * I need to add style-mobile.css to that but I dont know how…
 * Please help! 🙂

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [8 years, 7 months ago](https://wordpress.org/support/topic/function-php-adding-style-mobile-css-child-theme/#post-9632767)
 * Can you just add the CSS from within style-mobile.css to your Child Theme style.
   css file?
 *  Thread Starter [marcinstanczak](https://wordpress.org/support/users/marcinstanczak/)
 * (@marcinstanczak)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/function-php-adding-style-mobile-css-child-theme/#post-9632790)
 * I cant do that because my theme doesnt support that… When I change something 
   in style.css what is in style-mobile.css it just doesnt work… I try :first-child
   and others and nothing work…
    Now I change to function.php like I found in codex
 *     ```
       <?php
       /**
        *Recommended way to include parent theme styles.
        *(Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
        */  
   
         add_action( 'wp_enqueue_scripts', 'child_style' );
         function child_style() {
       	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
       	wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/style.css',array('parent-style'));
       	wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/style-mobile.css',array('parent-style'));
       }
   
       /**
        *Your code goes below
        */
       ```
   

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

The topic ‘function.php adding style-mobile.css child theme’ is closed to new replies.

## Tags

 * [child](https://wordpress.org/support/topic-tag/child/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [marcinstanczak](https://wordpress.org/support/users/marcinstanczak/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/function-php-adding-style-mobile-css-child-theme/#post-9632790)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
