css - Having issues Creating a Child Theme in WordPress -


hello followed steps on: https://codex.wordpress.org/child_themes

and still no luck, theme activates fine parent theme still remains active.

style.css: enter image description here

functions.php: enter image description here

file location & wp editor: enter image description here enter image description here

any appreciated thank you. again child theme not seem overwrite parent theme dalton.

you shouldn't need enqueue parent theme's stylesheet in child theme css - should enqueued (and may find, if in source, you've got 2 copies of parent theme stylesheet in place).

enqueue child theme stylesheet so:

add_action('wp_enqueue_scripts', 'my_the_enqueue_styles', 12); // give lower priority should enqueued after parent theme  function my_the_enqueue_styles() {     wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css'); } 

...then, in child theme css, add obvious like:

body {     background-color: purple; } 

...and should see child theme stylesheet loaded alongside parent theme elements.

it's worth noting get_template_directory_uri() refer parent theme, whereas get_stylesheet_directory_uri() refer currently-active child theme. if there no child/parent theme , you're using regular standalone theme, can use these commands interchangeably.


Comments