Home>Support>Child Theme – Enqueue Parent Css

Child Theme – Enqueue Parent Css

Hi there,

I’m trying to create a child theme to start doing my custom website, I’ve reading about it and searching here in the forum. For some reason, the CSS for the parent theme is only imported with the –

@import url(“../vantage/style.css”);

I had downloaded the vantage-child-vanilla-enqueue and even with the function.php code

Once I delete the @import line on the CSS , the import does not work anymore. I don’t understand why this is not working. I’ve just downloaded the theme, so I didn’t changed anything yet (that’s why I’m building a child theme from day first).

(I’m also using the vanilla child CSS):

/*
Theme Name: Vantage Child
Author: SiteOrigin
Author URI: https://siteorigin.com/
Theme URI: https://siteorigin.com/theme/vantage
Description: Vantage Child Theme
Version: 1.0.0
Template: vantage
Text Domain: vantage
Domain Path: /languages/
*/

/* =Theme customization starts here
————————————————————– */

There is any other change I have to do in order to work with my child theme?

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

  1. 9 years, 3 months ago Magus
    Hi, I Work Here

    Hi Letícia

    Please navigate to Appearance->Editor and select your child-theme’s functions.php file as the one you want to edit.

    Please ensure that the file contains the following lines.

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
            
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
    
    // END ENQUEUE PARENT ACTION
    

    Let us know how you get on

    Magus

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More