user6580560
user6580560

Reputation:

Wordpress child theme issue

I'm using a self made child theme for my Wordpress theme. Because I've so much files I've added some folders to my child theme and changed the path in the functions.php to make it a little bit clearer:

enter image description here


My folder structure:

enter image description here

Now I have the problem that Wordpress having issues loading my files:

(index):53 GET http://localhost/wordpress/wp-content/themes/Divicss/style.css?ver=4.9.8 net::ERR_ABORTED 404 (Not Found)

It loooks like that Wordpress is searching in the original theme but this is wrong. How can I fix this? Or is this even possible?

Upvotes: 0

Views: 402

Answers (1)

msg
msg

Reputation: 8161

get_template_directory_uri returns the path to parent theme. You have to use get_stylesheet_directory_uri. Also, keep in mind it doesn't append slashes at the end, so you have to do it yourself.

wp_enqueue_style('main_css', get_stylesheet_directory_uri() . '/css/style.css');

According to the developer documentation style.css is a required file, so maybe you can't move that particular file after all, or at least need a dummy one with the child's stanza.

Upvotes: 2

Related Questions