• Resolved Shkic

    (@shkic)


    Hi guys. After the update I noticed that my blocksy-child CSS file not loading at all.

    My blocksy-child CSS:

    style.css

    /**
     * Theme Name: Blocksy Child
     * Description: Blocksy Child theme
     * Author: Creative Themes
     * Template: blocksy
     * Text Domain: blocksy
    */
    
    and custom css ...
    
    

    My functions.php:

    <?php
    
    if (! defined('WP_DEBUG')) {
    	die( 'Direct access forbidden.' );
    }
    
    add_action( 'wp_enqueue_scripts', function () {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    });

    Before update, the child css worked.

    Updated from Version: 1.5.3 (if remember correctly) to 1.6.2.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author creativethemeshq

    (@creativethemeshq)

    Hey @shkic,

    We changed the way we load the main style.css in the latest update. That is for performance and correctness reasons. The proper way to load the style.css file from the child theme is the following: wp_enqueue_style('blocksy-child-style', get_stylesheet_uri());, that is, your functions.php file will look like this:

    
    <?php
    
    if (! defined('WP_DEBUG')) {
    	die( 'Direct access forbidden.' );
    }
    
    add_action( 'wp_enqueue_scripts', function () {
            // This will load child style.css file
    	wp_enqueue_style('blocksy-child-style', get_stylesheet_uri());
    });
    

    We made this optional so that we don’t get one additional CSS request by default for everyone who uses a child theme — not everyone wants to add CSS from the child.

    Hope that’s useful.

    Best regards!

    Thread Starter Shkic

    (@shkic)

    Thank you for your answer. Now everything is working! ??

    Theme Author creativethemeshq

    (@creativethemeshq)

    Glad it helped. Cheers!

    This probably should be noted somewhere so we don’t spend an hour trying to diagnose why it’s not working. Like maybe on this page for example? https://creativethemes.com/blocksy/docs/getting-started/child-theme/

    Or a notice when you install it..

    • This reply was modified 4 years, 9 months ago by qwik3r.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child theme CSS not loading’ is closed to new replies.