• Sorry, I can’t find a place to report this. So I’m having it in here.

    My child theme displays no styles and plain text only. Found out that when using a child theme. The functions.php line 151 will point to the child theme style.css.

    wp_enqueue_style( 'construction-base-style', get_stylesheet_uri(), array(), '1.0.3' );

    Solution: use get_template_directory_uri()

    wp_enqueue_style( 'construction-base-style', get_template_directory_uri() . '/style.css', array(), '1.0.3' );

    And here’s my child theme functions.php

    
    <?php
    
    /**
     * Enqueue theme scripts and styles.
     */
    function construction_base_child_scripts() {
    
        // Child theme stylesheet.
        wp_enqueue_style( 'construction-base-child', get_stylesheet_directory_uri() . '/style.css' );
    
    }
    add_action( 'wp_enqueue_scripts', 'construction_base_child_scripts' );
    
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using child theme won’t load the base css’ is closed to new replies.