Tell WordPress to Use the Default Theme

September 24, 2009 · Print This Article

The $theme variable of wordpress control the apparence of your wordpress, its value is the name of your wordpress theme.

We’ll show you how you can switch themes using a simple code snippet.

Just paste the following code in the functions.php file. When this code will be executed, the “default” theme will replace your current theme.

add_filter('option_template', 'themechoose');
add_filter('template', 'themechoose');
add_filter('option_template', 'themechoose');
add_filter('option_stylesheet', 'themechoose');
function themechoose($theme) {
$theme = 'default';
return $theme;
}


Your choice for site templates and wordpress themes

Comments

Got something to say?

You must be logged in to post a comment.