{"id":1180,"date":"2020-03-26T12:34:36","date_gmt":"2020-03-26T12:34:36","guid":{"rendered":"https:\/\/www.getbowtied.com\/?post_type=helpkit&p=1180"},"modified":"2020-03-26T12:35:35","modified_gmt":"2020-03-26T12:35:35","slug":"error-child-theme-not-loading-custom-style","status":"publish","type":"helpkit","link":"https:\/\/getbowtied.com\/documentation\/the-hanger\/customization-the-hanger\/error-child-theme-not-loading-custom-style\/","title":{"rendered":"Error: Child Theme not loading custom style"},"content":{"rendered":"\n
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<\/em> file. The enqueue function from\u00a0functions.php<\/em>\u00a0was modified to correctly enqueue the parent and the child css files, as said in the\u00a0WP Theme Child Handbook<\/a>. So:<\/p>\n\n\n\n to be replaced with\u00a0<\/p>\n\n\n\n That should do it.<\/p>\n","protected":false},"excerpt":{"rendered":" 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\u00a0functions.php\u00a0was modified to correctly enqueue the parent and the child css files, as said in the\u00a0WP Theme Child Handbook. So: add_action( ‘wp_enqueue_scripts’, ‘thehanger_enqueue_styles’, 100\u2026<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","helpkit-category":[145],"helpkit-tag":[],"yoast_head":"\nadd_action( 'wp_enqueue_scripts', 'thehanger_enqueue_styles', 100 );
\nfunction thehanger_enqueue_styles() {
\n wp_enqueue_style( 'getbowtied-child-styles', get_stylesheet_directory_uri() . '\/style.css', array( 'getbowtied-styles' ), wp_get_theme()->get('Version') );
\n}<\/pre>\n\n\n\nadd_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')
);
}
<\/pre>\n\n\n\n