WordPress use an option to store the current active child theme. This option is named 'stylesheet'
.
Using the filter 'pre_option_{$option_name}'
you can change every option getted by WP.
So, in your case you should hook the 'pre_option_stylesheet'
filter, use some logic to retrieve current season and return the child theme you want.
This workflow should be done in a plugin (loaded before theme and child theme), in this way you are sure it works.
Example plugin code:
<?php
/**
* Plugin Name: Seasoned Child Theme
* Plugin URI: http://wordpress.stackexchange.com/questions/114538/conditionally-load-child-themes
* Author: G.M.
* Author URI: http://wordpress.stackexchange.com/users/35541/
*/
add_action('pre_option_stylesheet', function() {
$seasons_themes = array(
// this are the child theme names (the folder name) related to season
'child_winter', 'child_spring', 'child_summer', 'child_autumn'
);
$m = intval( date('n') );
if ( $m < 3 || $m == 12 ) {
$theme = $seasons_themes[0];
} elseif ( $m > 2 && $m < 6) {
$theme = $seasons_themes[1];
} elseif ( $m > 5 && $m < 9) {
$theme = $seasons_themes[2];
} else {
$theme = $seasons_themes[3];
}
$root = get_theme_roots();
$path = false;
if ( is_string($root) ) {
$path = WP_CONTENT_DIR . "https://wordpress.stackexchange.com/" . $root . "https://wordpress.stackexchange.com/" . $theme ;
} elseif ( is_array($root) && isset($root[$theme]) ) {
$path = WP_CONTENT_DIR . "https://wordpress.stackexchange.com/" . $root[$theme] . "https://wordpress.stackexchange.com/" . $theme;
}
// if the theme exist return its name, if not return false
// (theme setted in backend will be used)
if ( $path && file_exists($path) ) return $theme;
return false;
});