Thanks fevered; I guess I should have mentioned that the standard procedure doesn’t work in this case.
The theme’s style.css file is just a placeholder, and the actual style sheets are in /assets/css/ subfolders. I can’t figure out how to configure the call to the style sheet and where to put it.
The child theme keeps referencing the min.css file from the parent theme, and I can’t find any references to the main stylesheet, sigma.css, anywhere in the template files.
This is far from a standard setup.
Yeah, instead of the standard procedure, you need to do things a bit differently for this theme. You need two files: style.css and functions.php. Your style.css should look like this:
/*
Theme Name: Sigma Child
Template: sigma
*/
/* Theme customizations go below this line
----*/
And in your functions.php:
<?php
function sigma_child_scripts() {
wp_enqueue_style( 'sigma-parent', get_template_directory_uri() . '/assets/css/sigma.min.css' );
wp_enqueue_style( 'sigma-child', get_stylesheet_uri(), array( 'sigma-parent' ) );
}
add_action( 'wp_enqueue_scripts', 'sigma_child_scripts' );
Thanks very much. I see how this should have done the trick, but I’m now seeing this in the source:
<link rel='stylesheet' id='sigma-parent-css' href='http://site.com/newsite/wp-content/themes/sigma/assets/css/sigma.min.css?ver=4.0' type='text/css' media='all' />
<link rel='stylesheet' id='sigma-child-css' href='http://site.com/newsite/wp-content/themes/sigmachild/style.css?ver=4.0' type='text/css' media='all' />
<link rel='stylesheet' id='sigmatheme-css' href='http://site.com/newsite/wp-content/themes/sigma/assets/css/sigma.min.css?ver=0.1.2' type='text/css' media='all' />
The calls to sigma-parent and sigma-child are there, but the original call to sigmatheme-css seems to be enqeued lower down, still, so my customizations aren’t working. I tried deregistering sigmatheme-css in the functions file but I’m not doing it right, clearly.
Try this function, instead:
<?php
function sigma_child_scripts() {
wp_dequeue_style( 'sigmatheme' );
wp_enqueue_style( 'sigma-parent', get_template_directory_uri() . '/assets/css/sigma.min.css' );
wp_enqueue_style( 'sigma-child', get_stylesheet_uri(), array( 'sigma-parent' ) );
}
add_action( 'wp_enqueue_scripts', 'sigma_child_scripts', 20 );
Ah, I hadn’t configured the “dequeue” line properly, among other things – thank you SO much for your help. That worked.
Hi aloeroot, mark this topic as resolved, if you’ve found what you were looking for! Have a good day.