Child Theme – Images Don't Load
-
Hello,
My images when referenced from CSS don’t load from the child theme but rather from the parent theme. Here is what the URL looks like when inspected thru the developer tools:
/wp-content/themes/twentythirteen/images/menu-bg.png
I use the following rule:
background: url('images/menu-bg.png');
The folder structure of the child theme is:
/twentythirteen-child/images/ – the same as the parent theme.
The functions.php is the same as the recommended from the codex:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
I’ve also tried the second snippet:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { 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') ); }
, but the result is the same. How to get the path to the image, except using ../twentythirteen-child/images ? Is there a way or I should do it like this?
Thank you for the assistance ??
- The topic ‘Child Theme – Images Don't Load’ is closed to new replies.