hi,
I’m using the Vantage theme and i’ve tried to create a child-theme to costumize the CSS of my website, but there’s a problem:
The style.css of the child theme doesn’t work, in fact it seems that it doesn’t overwrite the changes on the parent theme.
I wrote this code in functions.php of my child theme:
function my_theme_enqueue_styles() {
$parent_style = ‘vantage-style’;
wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array( $parent_style ),
wp_get_theme()->get(‘Version’)
);
}
add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’);
I hope someone can help me and I thank you in advance.
Hi Luca
CSS changes not taking effect can be due to specificity. If you inspect the markup with your browser’s developer tool, that should be visible. Please, send us a link to your site so I can take a quick look. If there is a particular CSS rule you’re having a problem with, please, let me know so I can take a look.
Thanks