NEED EXPERT SUPPORT? Contact our engineers


Error: Child Theme not loading custom style

If you’re using a child theme and after updating The Hanger to 1.6.2, the custom styles in the child are no longer loaded, please update the functions.php file. The enqueue function from functions.php was modified to correctly enqueue the parent and the child css files, as said in the WP Theme Child Handbook. So:

add_action( 'wp_enqueue_scripts', 'thehanger_enqueue_styles', 100 );
function thehanger_enqueue_styles() {
wp_enqueue_style( 'getbowtied-child-styles', get_stylesheet_directory_uri() . '/style.css', array( 'getbowtied-styles' ), wp_get_theme()->get('Version') );
}

to be replaced with 

add_action( 'wp_enqueue_scripts', 'thehanger_enqueue_styles', 99 );
function thehanger_enqueue_styles() {
    // enqueue parent styles
    wp_enqueue_style( 'thehanger-styles', get_template_directory_uri() . '/css/styles.css' );
    // enqueue child styles
    wp_enqueue_style( 'thehanger-child-styles',
        get_stylesheet_directory_uri() . '/style.css',
        array( 'thehanger-styles' ),
        wp_get_theme()->get('Version')
    );
}

That should do it.