• Hi, i’m trying to display a theme based on the current logged user given the templates all work. This is a barebones of the “User Theme” plugin. This should work but it doesn’t … it replaces the css correctly but not the theme files (i.e. home.php) … WHAT AM I MISSING?

    As a side effect, the “Active Theme” gets overridden, but that’s ok.

    This is the php code:

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

Viewing 1 replies (of 1 total)
  • Thread Starter Federico Jacobi

    (@federico_jacobi)

    oops … here’s the code:

    function fb_user_theme() {	
    
    	global $user_login;
    
    	if ( $user_login == 'myuser' ) {
    		return 'twentyten';
    	} else {
    		return 'default';
    	}
    }
    
      add_filter('stylesheet', 'fb_user_theme');
      add_filter('template', 'fb_user_theme');
Viewing 1 replies (of 1 total)
  • The topic ‘Odd behavior … apply_filter('template')’ is closed to new replies.