Your theme is calling an additional stylesheet named black.css
after your child theme’s main stylesheet. The styles in black.css
are overriding your color rules in your child theme’s stylesheet. A quick fix would be to use !important
in your child theme’s stylesheet.
You are doing nothing wrong, actually. Part of the reason that your child theme isn’t overriding the color is, as stephen stated, the second stylesheet is being loaded.
There are several ways of going about this and they all depend on how comfortable you are with code and editing files.
== Version one ==
1. Create a header.php file and remove the line:
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
2. Create a functions.php file and add:
add_action( 'wp_enqueue_scripts', 'child_style' );
function child_style(){
wp_enqueue_style( 'parent', PC_THEME_ROOT_URI . '/style.css' );
wp_enqueue_style( 'child', get_stylesheet_uri(), array( 'parent', 'color-scheme-stylesheet' ) );
}
== Version Two ==
1. Create a header.php file and move the line:
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
after <?php wp_head(); ?>
== Version three ==
1. use !important
on all the rules that are being a pain in the tushy.
Thank you very much for the help! Jose, I used both of your first two solutions and both worked perfectly. I’m going to continue to use the first version, because I’m guessing it’s the most standard, or you wouldn’t have mentioned it first. (I have experience in CSS and HTML, but PHP is new to me.)
I also didn’t know about !important. What a great command. This should help me very much.
Thank you thank you thank you!
Happy to help.
Yes, the first is sort of a standard when it comes to stylesheets and scripts and is standard theme review guidelines. Part of that reason is so that if any child themes or plugins rely on certain scripts/styles won’t misbehave. 🙂