Child theme header backround
This support request was posted in Flatbase by LottaC
- LottaC March 9, 2016 at 2:48 pm
I installed child theme, however I cant change header bg color. I have done this in parent and child theme settings, if I activate parent, then color is ok, but if I activate child, it restores back to default. Other settings like logo seem to be ok.
Already tried to deactivate/activate plugins and themes.
Here’s the css in console (#00354d is the color I want).
media=”all”
#header {
min-height: 120px;
background: #35a49e; // this is shown
}#header {
background-color: #00354d;
}Ricardo Aiello March 10, 2016 at 11:08 amHi LottaC,
Thanks for reaching us.
As far as I could test here, it seems to depend on how you load the stylesheets in your child theme. Testing in our local environment, I’m doing it with only the following two files:
style.css
/* Theme Name: Test Child Theme Author: NiceThemes Template: flatbase */
functions.php
< ?php if ( ! function_exists( 'test_child_theme_enqueue_styles' ) ) : add_action( 'wp_enqueue_scripts', 'test_child_theme_enqueue_styles', 0 ); /** * Enqueue parent and child theme styles. */ function test_child_theme_enqueue_styles() { $parent_style = 'parent-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 ) ); } endif;
Note that the function is hooked with a priority of zero. This way the styles defined in the options (which are added inline) will be processed later, and will override the default styles properly.
Please let me know if this method works for you, and if I can be of further assistance.
Best,
Ricardo
Ricardo Aiello March 10, 2016 at 12:20 pmGreat! Please contact us again if you run into any other issues.
Ricardo
This topic is marked as resolved
Only the topic author can re-open this thread.