Thanks to MarsianBoy for your research. I’m having the same problem. Tried the code, perhaps incorrectly; didn’t work. Sorry for long excerpts, but I am as clueless as anyone. Using parent theme “writr”, which enqueues stylesheets thus:
/* Register Google fonts. */
function writr_fonts() {
...
if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'writr' ) ) {
wp_register_style( 'writr-montserrat', "https://fonts.googleapis.com/css?family=Montserrat:400,700", array(), null );
}
}
add_action( 'init', 'writr_fonts' );
/* Enqueue scripts and styles. */
function writr_scripts() {
wp_enqueue_style( 'writr-montserrat' );
if ( wp_style_is( 'genericons', 'registered' ) )
wp_enqueue_style( 'genericons' );
else
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/css/genericons.css', array(), null );
wp_enqueue_style( 'writr-style', get_stylesheet_uri() );
$colorscheme = get_theme_mod( 'writr_color_scheme' );
if ( $colorscheme && 'default' !== $colorscheme )
wp_enqueue_style( 'writr-color-scheme', get_template_directory_uri() . '/css/' . $colorscheme . '.css' , array(), null );
if ( get_theme_mod( 'writr_wider_style' ) )
wp_enqueue_style( 'writr-wider-style', get_template_directory_uri() . '/css/wider.css' , array(), null );
...
}
My child functions.php contains:
<?php
function theme_enqueue_styles() {
wp_enqueue_style( 'writr-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style(
'writr-child-style',
get_stylesheet_directory_uri() . '/style.css',
array('writr-style')
);
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
?>
My child style.css has all the necessary header comments (from the Codex), then:
blockquote {
font-style: italic;
}
On my site, <blockquote>
is correctly styled with italic, so I know that my stylesheet is being read; and most of the basic styling from the parent theme also appears to be in effect. The problem is that the content-area is too narrow. The parent theme writr, in the main style.css, says:
.content-area { ...
width: 540px;
... }
Another stylesheet in parent theme, css/wider.css, is supposed to override this (and does so correctly when the parent theme is in effect):
@media only screen and (min-width: 1220px) { ...
.content-area {
width: 800px;
} ...
}
So it seems that css/wider.css is not being read in.
In the example child functions.php here, there is a comment:
/* Twenty Fourteen functions and definitions*/
Does that mean to copy and paste the entire body of the parent functions.php into your child functions.php? If you do that, wouldn’t that prevent my site from seeing updates to the parent theme’s functions.php? Also, I think that it would break things to call all those functions twice, right?