Hi,
Create functions.php in your child theme. Inside that add these code
<?php
function call_my_class()
{
wp_enqueue_style( 'child-main', get_stylesheet_directory_uri()."/child-style.css" );
}
add_action( 'wp_enqueue_scripts', 'call_my_class',999);
?>
Then, create a file named “child-style.css” in your child theme. So, in future any style created inside child-style.css will help you override main.css styles from the child theme.
Thanks Vijay, that’s done the trick!
Hi Vijay.
I created a “sixteen-child” theme folder in my themes folder, activated it and in it put custom footer.php, home.php and style.css files. The footer and home pages are working fine, but the css file is not being invoked. I tried creating a functions.php file but it doesn’t work. Help! Here’s the code:
<?php
function call_my_class()
{
wp_enqueue_style( ‘child-main’, get_stylesheet_directory_uri().”../style.css” );
}
add_action( ‘wp_enqueue_scripts’, ‘call_my_class’,999);
?>