Home>Support>Trouble with including Influence parent theme style.css in child theme

Trouble with including Influence parent theme style.css in child theme

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello, I have create a child theme of Influence and setup in my local site.

This is working and before I was using @import to including main parent theme style.css. I’ve since learned this isn’t best practice.

I’ve tried to enqueue the parent theme style.css but this doesn’t work. I’ve come across a previous post and modified the example code to the following:

/**
 * Enqueue the parent theme stylesheet.
 */
function influence_child_enqueue_parent_style() {
    wp_enqueue_style( 'influence-parent-style', get_template_directory_uri() . '/style.css');
}
add_action( 'wp_enqueue_scripts', ‘influence_child_enqueue_parent_style’, 8 );

But this still doesn’t work. This is the only code in my functions.php

I have also tried the wordpress codex suggestion, but that didn’t work either:

function my_theme_enqueue_styles() {

    $parent_style = 'influence-style';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );

If I remove the code and switch back to the

@import url("../influence/style.css");

Have I gone about this in the wrong way?

Thanks in advance

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More