Okay
  Public Ticket #1738144
Child Theme style.css not loading
Closed

Comments

  •  2
    standiers started the conversation

    Hi,

    I have just installed Kalium for my portfolio site. The site is currently behind a coming soon page.

    I am starting to add custom css rules to the child theme but they are not taking effect. When I check the page resources, I can see the style.css from Kalium but not the one from kalium-child. Could there be something preventing it to load?

    I installed the child theme using the zip folder provided in the full Kalium package. It is my 4th licence now and the first time I encounter this issue.

    I would appreciate your help.Thank you.
    Stan

    url: www.standiers.com

  •   standiers replied privately
  •  1,560
    Laborator replied

    Hi there,

    The way you have added custom CSS it is not the way you should add it, please follow this guide to add Custom CSS instead of adding CSS in the style.css.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    standiers replied

    Hi Art,

    Strange for other projects using Kalium, I always used the style.css of the child theme to add custom styles. Has something changed?

  •  2
    standiers replied

    Ok I found the issue myself. The fonction.php provided in the child-theme folder had one line of the enqueue disabled, making the child-theme style.css not load.
    This line:  wp_enqueue_style( 'kalium-child', get_stylesheet_directory_uri() . '/style.css' );

    So the function.php must read:

    <?php
    /**
     * Kalium WordPress Theme
     *
     * Laborator.co
     * www.laborator.co 
     */

    // After theme setup hooks
    function kalium_child_after_setup_theme() {
    // Load translations for child theme
    load_child_theme_textdomain( 'kalium-child', get_stylesheet_directory() . '/languages' );
    }

    add_action( 'after_setup_theme', 'kalium_child_after_setup_theme' );

    // This will enqueue style.css of child theme
    function kalium_child_wp_enqueue_scripts() {
    wp_enqueue_style( 'kalium-child', get_stylesheet_directory_uri() . '/style.css' );

    }

    add_action( 'wp_enqueue_scripts', 'kalium_child_wp_enqueue_scripts', 100 );


    Now that it is enabled, it works well. Hope this helps anyone else.

  •  1,560
    Laborator replied

    Hi again,

    I am happy to hear that you found out the fix for the issue, anyway as I mentioned before we do not recommend adding CSS in the theme files and that is why we have built up a Custom CSS area where you can overwrite the CSS of the theme, this way none of the changes will be lost and it is more user friendly.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group