I’m integrating wordpress into another application by calling
require("../wp-blog-header.php");
I would like to be able to specify the theme to use based on some conditions before the wp-blog-header.php file is called. Is there a constant, function or variable that I can use to set the theme directory to something different than is already set?
I’m trying to find where WordPress sets the theme directory to use before it loads the templates, etc. so that I can change it on the fly if necessary.
Update:
I tried adding this in an activated plugin:
add_filter('template', 'change_the_template');
function change_the_template()
{
$theme = get_theme('Twenty Eleven');
return $theme['Template'];
}
But that didn’t change it to display with the Twenty Eleven template which is different than the one set in the admin…
The code you have, changes the template but you will also have to change the stylesheet for the theme.
Add the following code along with what you already have(in activated plugin).
This should solve the problem.