The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  Direct Affiliate

Wordpress Mu Problem

monsterpot

New Member
affiliate
I have WPMU installed and I want a new MU blog to use one of the templates in my themes folder, not the default one.

I can rename any of the templates to default, and it will use that one, but I would lke it to choose a random template if possible.

Does anyone know which PHP file I would have to change in WP ? I've had a look through the includes, and admin files but I can't see a solution, and I can't find any help on wp.org either.

Thank
 
i am no expert, but it seems that:
PHP:
function get_template() {
	return apply_filters('template', get_option('template'));
}

this is the function as defined in wp-includes/theme.php that reverts to wp options. i tried the following:
PHP:
function get_template() {
    $themes = get_themes();
    
    foreach($themes as $theme => $settings) {
        $short[] = $settings['Template'];
    }    
	return apply_filters('template', $short[rand(0,count($short)-1)]);
}

this works but it is not sufficient - you end up with a mix of the current template and the random one. i guess there are more functions that check the default but i don't know WP well enough to speculate and i don't have time to debug it right now... hope this has put you in the right direction though. if i had to hazard a guess, check function get_current_theme() :)
 
Thanks for trying, but can't figure it out. As you say, it messes the style up.

But I got another challenge for you and thats how can I have a plugin activated by default for all new blogs? Putting the plugin in the mu plugin folder doesn't work.
 
sorry mate, i thought my signature was clear enough on my feelings towards wordpress :D

and if you change get_current_theme() as well, it ought to work
 
I've done a search but can't find anything.

I'm just going to rename a template to default and do it that way, but the random tempalte would have been nice
 
MI
Back