Override Current Theme Setting in wp_config.php

Drop this in a plugin & activate. I should note this doesn’t take into account things like child themes – it’s purely for toggling which theme renders based on SOME_FLAG.

add_filter( 'stylesheet', 'switch_ma_theme' );
add_filter( 'template',   'switch_ma_theme' );

function switch_ma_theme()
{
    // Return the theme directory name
    return SOME_FLAG ? 'theme-1' : 'theme-2';
}

Leave a Comment