child theme - WordPress childtheme not loading any CSSSCSS

I'm using the BigFoot theme and I've made a child theme from this. I've set everything up, my child theme

I'm using the BigFoot theme and I've made a child theme from this. I've set everything up, my child theme is activated in the wp-admin and everything looks good but for some reason my page isn't loading any CSS.

I'm writing SCSS and converting it into CSS with a build task, when I run the build task it succesfully compiles the SCSS to CSS.

This is my functions.php page

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
//deze code laadt de CSS van de PARENT get_template_directory_uri()
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
//laadt ook de  eigen CSS

wp_enqueue_style( 'child-style', get_stylesheet_directory_uri(  ) . '/css/screen.css', array('parent-style', 'bigfoot-style', 'bigfoot-css'), wp_get_theme()->get('Version'));

}

This is the style.css page

/*
Theme Name:   Bigfoot Child
Theme URI:    ***************
Description:  Bigfoot Child Theme
Author:       ***************
Author URI:   ***************
Template:     bigfoot
Version:      1.0.0
License:      GNU General Public License version 3.0
License URI:  .0.html
Tags:         light, two columns
Text Domain:  bigfootchild
*/

I've already tried a bunch of solutions I found online but none of them seem to be working. Any idea on what I'm doing wrong?

Any help would be highly appreciated!

I'm using the BigFoot theme and I've made a child theme from this. I've set everything up, my child theme is activated in the wp-admin and everything looks good but for some reason my page isn't loading any CSS.

I'm writing SCSS and converting it into CSS with a build task, when I run the build task it succesfully compiles the SCSS to CSS.

This is my functions.php page

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
//deze code laadt de CSS van de PARENT get_template_directory_uri()
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
//laadt ook de  eigen CSS

wp_enqueue_style( 'child-style', get_stylesheet_directory_uri(  ) . '/css/screen.css', array('parent-style', 'bigfoot-style', 'bigfoot-css'), wp_get_theme()->get('Version'));

}

This is the style.css page

/*
Theme Name:   Bigfoot Child
Theme URI:    ***************
Description:  Bigfoot Child Theme
Author:       ***************
Author URI:   ***************
Template:     bigfoot
Version:      1.0.0
License:      GNU General Public License version 3.0
License URI:  http://www.gnu/licenses/gpl-3.0.html
Tags:         light, two columns
Text Domain:  bigfootchild
*/

I've already tried a bunch of solutions I found online but none of them seem to be working. Any idea on what I'm doing wrong?

Any help would be highly appreciated!

Share Improve this question asked Jun 17, 2020 at 14:41 MaximMaxim 1 3
  • Can you try removing the forward slash from the stylesheet path? Try this: get_stylesheet_directory_uri() . 'css/screen.css' – Tony Djukic Commented Jun 17, 2020 at 17:26
  • I tried that but unfortunately it didn't do anything – Maxim Commented Jun 18, 2020 at 9:08
  • I do get this warning "Failed to load resource: the server responded with a status of 404 (Not Found)" when inspecting my page but I don't see anything wrong with my stylesheet link. I've already tried multiple different slash combinations too... <link rel="stylesheet" href="../css/screen.css"> – Maxim Commented Jun 18, 2020 at 9:09
Add a comment  | 

1 Answer 1

Reset to default 0

after you registered and activated child theme you should add wp_enqueue_style( 'child-style', get_stylesheet_directory_uri( ) . '/css/screen.css', array('parent-style', 'bigfoot-style', 'bigfoot-css'), wp_get_theme()->get('Version'));

in your childs theme functions , i assume by adding get_stylesheet_directory_uri( ) to your main theme ytou get wrong path , and there is a space in get_stylesheet_directory_uri( ) <=== please remove space from brackets.```

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742261346a4410965.html

相关推荐

  • child theme - WordPress childtheme not loading any CSSSCSS

    I'm using the BigFoot theme and I've made a child theme from this. I've set everything up, my child theme

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信