child theme
-
Hello
Why when I create a child theme from the main designexo theme, all the css are not loaded properly? I tested this on 3 separate WordPress on localhost.
The first two screens are the parent theme, i.e. designexo itself, and the rest of the screens are related to the child theme. Below I will put the css file and function for better guidance.Css child theme
/*
Theme Name: Designexo Child Theme
Template: designexo
Version: 1.0
Description: Child theme for Designexo
*/functions child theme
<?php
function child_theme_enqueue_styles() {
// Load the parent template style
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
// Load other required CSS files from the parent template
wp_enqueue_style( 'parent-theme-default', get_template_directory_uri() . '/assets/css/theme-default.css' );
// Load child template style (if any)
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
}
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );
?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.