@jreeve This is what I do:
/**
* Enqueue Custom CSS in CBOX child theme
*/
function my_cbox_enqueue_styles() {
// load our custom CSS
wp_enqueue_style(
'my_child_styles',
get_stylesheet_directory_uri() . '/assets/css/my-child-styles.css',
array( '@:dynamic' ),
0.1, // version
'all' // media
);
// if we've got the homepage template...
if ( is_page_template('templates/homepage-template.php') ) {
// force flexslider CSS to load
wp_enqueue_style(
'flex_slider',
get_template_directory_uri() . '/assets/css/flexslider/flexslider.css',
null, // array( 'deps' ),
0.1, // version
'all' // media
);
}
}
// add a filter for the above
add_action( 'wp_enqueue_scripts', 'my_cbox_enqueue_styles', 100 );
In case you’re wondering, I found that the flexslider CSS doesn’t load on child themes, which is why I force it to load. Would be interested to hear if you see the same behaviour.