Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter ayman1

    (@ayman1)

    Turns out that, since 2.5.0, there is a function called switch_theme()! It’s in wp-includes/theme.php:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    So, it looks like the main thing I was missing was the do_action() at the end. So, the code should be:

    $theme = get_theme_of_today();
    switch_themes($theme['Template'], $theme['Stylesheet']);
    function get_theme_of_today() {
       $day = (int) date('z');
       $themes = get_themes();
       $i = $day % count($themes);
       return $themes[$i];
    }
Viewing 1 replies (of 1 total)