OK… I never told anyone, but the reason I asked for help above was because no matter what I tried to do in my child theme… there was no change on the rendered site… It was really bothering me… I thought was doing something wrong, and that i needed to learn how to do child themes better. This is my first one… ??
I reasoned my style sheets were not being used and thought I had missed some step.. but when I looked in the theme editor window I could clearly see that my child’s style.css was there. Days later I looked at source code of a rendered page and clearly saw the style sheets belonged to the parent, NOT the child! There were no paths to any child .css to be found. So then I really started digging through the code doing a lot of head scratching…
Tonight, I found the problem, and fixed it. I need confirmation on this though. Is anyone else making child themes from this experiencing difficulty changing style parameters, or even adding new styles? Everyone with a JustWrite-child should be seeing this problem, not just me…
Here is what’s happening:
Functions.php contains the following Load CSS function: ac_css_files()
Inside that function, calls to wp_enqueue_style() are getting the stylesheets using get_template_directory_uri().
Code Example from ac_css_files() near line 100:
// Enqueue
wp_enqueue_style( 'ac_style', get_template_directory_uri() . '/style.css', array(), '1.0.1', 'all' );
wp_enqueue_style( 'ac_media_queries', get_template_directory_uri() . '/assets/css/media-queries.css', array(), '1.0.1', 'all' );
wp_enqueue_style( 'ac_icons', get_template_directory_uri() . '/assets/icons/css/font-awesome.min.css', array(), '4.0.3', 'all' );
I read a bunch of docs in WP Codex about themes and they all talk of using get_stylesheet_directory_uri() to make the theme work correctly when you need to insure the theme can be easily turned into a child theme later.
So.. I changed it in my child’s functions.php so it looks like this:
// Enqueue
wp_enqueue_style( 'ac_style', get_stylesheet_directory_uri() . '/style.css', array(), '1.0.1', 'all' );
wp_enqueue_style( 'ac_media_queries', get_stylesheet_directory_uri() . '/assets/css/media-queries.css', array(), '1.0.1', 'all' );
wp_enqueue_style( 'ac_icons', get_stylesheet_directory_uri() . '/assets/icons/css/font-awesome.min.css', array(), '4.0.3', 'all' );
That did it… Everything works fantastic now… I can change anything and see it working! I hope this helps anyone else struggling to make this fantastic professional looking theme into a child!
cheers!