1
votes

My parent theme has a style sheet: app/assets/css/screen.css which contains all of the theme's style for some reason instead of being in /style.css

Since I am customizing the theme I have set up a child theme but the changes that I add into my child theme's style.css don't work.

How can I add the app/assets/css/screen.css stylesheet to my child theme so I can make the necessary modifications?

1
Might be your child theme style.css file is loading before the app/assets/css/screen.css - Post your WordPress related question in the Wordpress Stack ExchangeMaqk

1 Answers

-1
votes

The recommended way of enqueuing the parent theme stylesheet currently is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme’s functions.php.

Load your style.css file with a proper handler as you said you have more than one style.css file you will have to make sure to maintain all of the Parent Theme dependencies.

if ( ! function_exists( 'prefix_theme_enqueue_scripts' ) ) {
    function prefix_theme_enqueue_scripts() {
        wp_enqueue_style( 'parent_handler', get_template_directory_uri() . '/app/assets/css/screen.css' );
        wp_enqueue_style( 'child_handler',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent_handler')
        );
    add_action( 'wp_enqueue_scripts','prefix_theme_enqueue_scripts' );
    }
}

where parent_handler is the same $handle used in the parent theme when it registers it’s stylesheet. Check your parent theme for handler