my child theme CSS is unreliable
-
I’ve been having much difficulty with updating my child theme’s CSS. Edits made in WordPress’s Appearance / Editor would not appear in the site, although sometimes they would an hour later. I thought it was an enqueueing problem, struggled with the child functions.php code, and eventually got that to work (see below) – for a couple of hours. But the next day, changes made to the CSS from the WordPress Editor would not appear when refreshing the browser. And then suddenly, with a refresh of the browser, I lost the header image and the menus are a mess. This could be because many of my prior CSS experiments – which I thought had no effect – simply never loaded before.
I’m quite confused, but I think these may be clues:
- when I view page source, 13 stylesheets are listed. the 6th one’s id=’twentysixteen-style-css’; the 7th one’s id=’child-style-css’
- In the comments of my (child) style.css file, I have:
Description: Twenty Sixteen Child Theme
Version: 1.0.0.1517610849
Updated: 2018-02-02 22:34:09
Is the ‘version’ and ‘updated’ info supposed to automatically update when the editor is used? If so, that’s not happening.
My child functions.php code:
<?php function my_theme_enqueue_styles() { $parent_style = 'twentysixteen-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' ); ?>
The page I need help with: [log in to see the link]
- The topic ‘my child theme CSS is unreliable’ is closed to new replies.