in a child theme of WP theme "twenty-twenty-one" I like to remove the original style.css of the parent theme - based in the link-tag id='twenty-twenty-one-style-css' - from the header.
Here is the code
<link rel='stylesheet' id='twenty-twenty-one-style-css' href='http://localhost/ml_wp_220228/wp-content/themes/twentytwentyone/style.css?ver=6.1.1.1646164756' media='all' />
<link rel='stylesheet' id='chld_thm_cfg_separate-css' href='http://localhost/ml_wp_220228/wp-content/themes/cpeach_theme_21/ctc-style.css?ver=6.1.1.1646164756' media='all' />
The first css-link-tag - id "twenty-twenty-one-style-css" - should be removed, only the second - my own css - should stay.
I tried it with some coding in the function.php of the child theme.
function dequeue_css() {
wp_dequeue_style('twenty-twenty-one-style');
wp_deregister_style('twenty-twenty-one-style');
}
add_action('wp_enqueue_scripts','dequeue_css');
When I tried the function with a style, I created by myself before - for instance id "css-link chld_thm_cfg_separate-css" - everything worked fine.
Trying the same with the style.css of the parent - id='twenty-twenty-one-style-css' - didn't work.
Please, can you give me a hint.
Thanks
Frank