Child Theme Style Issues

Zoe Turton September 24, 2019 at 7:34 pm

I’ve created a child theme but it’s not handling styles correctly, and there are a couple weird things about it.

1. I would expect to need to enqueue the KrystalPro parent styles in my child theme’s functions.php file, but the parent styles load with just the style.css plus an empty functions.php
2. The custom CSS I have in my child theme’s style.css don’t seem to be getting enqueued, though the style.css file is definitely loading because when I empty it out to test, the page load results in the error that it should.

Searching around online indicates that this may be an issue with the way the parent them handles style dependencies – do you know if there’s a special theme-specific way I need to be enqueuing my styles, or if there’s a known bug or workaround, or anything like that?

My style.css just has this:
/*
Theme Name: KrystalPro Child
Template: krystalpro
*/
.example-css-class .for-spiraclethemes-post {
text-align: center
}

And my functions.php is only loading custom widgets:
<?php
require get_stylesheet_directory() . ‘/inc/widgets.php’;

And again, with the above style and functions files, it does load the parent styles but doesn’t accept my customizations.

Replies (3)

  1. Zoe Turton September 24, 2019 at 7:34 pm

    I’ve created a child theme but it’s not handling styles correctly, and there are a couple weird things about it.

    1. I would expect to need to enqueue the KrystalPro parent styles in my child theme’s functions.php file, but the parent styles load with just the style.css plus an empty functions.php
    2. The custom CSS I have in my child theme’s style.css don’t seem to be getting enqueued, though the style.css file is definitely loading because when I empty it out to test, the page load results in the error that it should.

    Searching around online indicates that this may be an issue with the way the parent them handles style dependencies – do you know if there’s a special theme-specific way I need to be enqueuing my styles, or if there’s a known bug or workaround, or anything like that?

    My style.css just has this:
    /*
    Theme Name: KrystalPro Child
    Template: krystalpro
    */
    .example-css-class .for-spiraclethemes-post {
    text-align: center
    }

    And my functions.php is only loading custom widgets:
    <?php
    require get_stylesheet_directory() . ‘/inc/widgets.php’;

    And again, with the above style and functions files, it does load the parent styles but doesn’t accept my customizations.

  2. Spiracle Themes September 25, 2019 at 5:10 am

    Hi Zoe,

    Use this child theme

    Krystal Pro Child Theme

    Best Regards

  3. Zoe Turton September 25, 2019 at 7:18 pm

    It is happy, now! Thank you!

  4. Spiracle Themes September 26, 2019 at 5:33 am

    You are welcome 🙂

Post a Reply

Reply To: Reply #1785 in Child Theme Style Issues
Your information:




Cancel