WordPress Child Theme CSS stylesheets not working
I created a child theme with the Child Theme Configurator plugin, but for some reason no styles I type into the child theme’s stylesheets take effect on the website. I think it must have something to do with the functions.php file, but the code in this file currently makes no sense to me.
The child theme has two stylesheets: style.css and ctc-style.css
The parent theme seems to have various style sheets that must be included.
Any help will be greatly appreciated.
This is what I see in the functions.php after creating the child theme:
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
function chld_thm_cfg_locale_css( $uri ){
if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
$uri = get_template_directory_uri() . '/rtl.css';
return $uri;
}
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
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', array( 'fontello-style' ) );
}
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
if ( !function_exists( 'child_theme_configurator_css' ) ):
function child_theme_configurator_css() {
wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( 'chld_thm_cfg_parent','themerex-main-style','themerex-animation-style','themerex-bbpress-style','themerex-buddypress-style','themerex-skin-style','themerex-custom-style','themerex-responsive-style','themerex-skin-responsive-style' ) );
}
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );
// END ENQUEUE PARENT ACTION ```
Leave an answer