I've created a child theme but the parent theme seems to use bloginfo('stylesheet_directory') to point to a lot of CSS and js files, none of which are currently loading.

As I believe the 'stylesheet_directory' is meant to point to the main CSS file directory, my child theme, am I going to have to copy the header into my child theme and update the paths with a different shortcode?

Is there a better way?


If the parent theme is properly coded, the following code in the child theme functions.php file should load the parent css.

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );


As for the javascript, I think that if the parent theme loads theme with wp_enqueue_scripts they should work in the child theme.

  • Thanks. I've got that in my functions.php files but it looks like the parent theme wasn't properly built. A lot of the links for css and js use bloginfo('stylesheet_directory') which is pointing to the child theme. – Ross Coulbeck Jan 13 '19 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.