How do I get from search_theme_directories() to the $stylesheet (name) for switch_theme()
But I can’t seem to sort out how to get the $stylesheet. Easy. $themes = search_theme_directories(); // a random theme $themename = array_rand($themes,1); // that random theme’s stylesheet $stylesheet = content_url(‘/themes/’.$themes[$themename][‘theme_file’]); // The absolute path to that theme’s stylesheet $stylepath = WP_CONTENT_DIR.’/themes/’.$themes[$themename][‘theme_file’]; Getting a random theme that is not a child is more involved. I … Read more