-1

I'm using the Twentyeleven theme for my new site. I created a child-theme so I can modify the theme and not have my changes overwritten. But once I activate my child-theme the whole styling is gone. I guess the issue lies in the functions.php. Maybe I did something wrong. Can anyone point me in the right direction?

This is my functions.php in my child-theme:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_stylesheet_directory_uri() . '/style.css' );
}
  • <?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_stylesheet_directory_uri() . '/style.css' ); } – Sabine Dec 1 '17 at 16:12
1

You will want to use get_template_directory_uri() to load files from the parent theme. get_stylesheet_directory_uri() is for the current theme, which is your child theme.

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.