I’m trying to learn how to do child/parent themes with wordpress. I am using pure by gt3themes. I followed the WP documentation for enqueing the style as closely as I could, but the child theme produces a blank screen.

The action seems to be catching the function to enqueue, and I did notice that the theme uses a sub-folder function to enqueue (located pure/core/registrator/css-js.php), rather than the functions.php. Could this be the cause of the heartbreak?

Either way, this is the code I have:

function child_theme_css_register() {
    $parent_style1 = 'gt3_default_style';
    $parent_style2 = 'gt3_theme';

    wp_enqueue_style( $parent_style1, get_bloginfo('stylesheet_url'));
    wp_enqueue_style( 'pure-child-default-style',
        get_bloginfo('stylesheet_url'),
        array( $parent_style1 ),
        wp_get_theme()->get('Version')
    );

    wp_enqueue_style( $parent_style2, get_template_directory_uri() . '/css/theme.css');
    wp_enqueue_style( 'pure-child-theme-style',
        get_stylesheet_directory_uri() . '/css/theme.css',
        array( $parent_style2 ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'child_theme_css_register' );

Read more here: Blank Child Theme – Style enqueue not in functions


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: