Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to enqueue parent styling in child theme WordPress

  • SOLVED

I have a parent theme that has a style sheet here:

theme-name/assets/apps.css

I'm trying to create a child theme and enqueue app.css in the child theme.

Tried this:

<?php
/**
* child theme functions
*
* @package My Theme
*/

add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'app.css' );
}


But, no luck.

Answers (2)

2015-09-19

Romel Apuya answers:

<?php
/**
* child theme functions
*
* @package My Theme
*/
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/assets/app.css' );
}


Kyler Boudreau comments:

Romel - thank you. Worked great.

2015-09-19

Kyle answers:

Try this:

add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

function enqueue_parent_styles() {

wp_enqueue_style( 'parent-style', get_theme_root_uri().'/theme-name/assets/app.css' );

}