I have a child-theme -> parent-theme setup, where I need to have stylesheet called generated.css loaded in addition to the style.css file added by the active child-theme. The generated.css file is residing in the parent-theme and is being dynamically generated and provided by the parent-theme..
I started out the obvious way, simply adding an import rule to the beginning of the child-themes style.css:
/* Get Parent BASE CSS */ @import url('../parent-theme/style.css'); /* Get Parent GENERATED CSS */ @import url('../parent-theme/generated.css');
But this does not work for two reasons.
1) I want to be able to add a cache-busting version number to the file:
<link rel='stylesheet' href='http://www.com/wp-content/themes/parent-theme/generated.css?ver=2389642855'>
2) I want the file to be loaded last, after the child themes style.css
Is it possible to hook in the loading of this generated.css stylesheet into the head so it is added after the child-theme's style.css using the functions.php of the parent theme?
What hook or WP mechanism could I use?