WordPress.org

Ready to get started?Download WordPress

Forums

Assign a theme to a specific user (4 posts)

  1. 4k
    Member
    Posted 6 years ago #

    I have a co-author on one of my blogs with a very old computer.

    I would like to be able to assign a minimal theme to her user profile only.

    I saw this plugin but have no idea how to implement it and the site is in german.

    http://wordpress.org/extend/plugins/user-theme/

    is there another way? or can someone tell me how to fill in the fields properly on the plugin?

  2. whistler2020
    Member
    Posted 6 years ago #

    the install directions are on the second tab of the plugin page

    http://wordpress.org/extend/plugins/user-theme/installation/

  3. 4k
    Member
    Posted 6 years ago #

    Yes I have read that, however, it shows two fields changed which I have done here*, but what of the other fields?

    *the theme and ID

    When I activate it based on this code I get a blank page front end, so not working for me.

    function fb_user_theme($template = 'WP-Andreas09') {
    
    	// en_US: replace space in the name of a theme-folder with _ (underline)!
    	// de_DE: Leerzeichen im Namen des Themes muessen mit _ (underline) ersetzt werden!
    
    	// when Profil-ID
    	// see in backend exmaple.org/wp-admin/users.php
    	if (get_profile('3') == 1) {
    		$template = 'default';
    	}
    
    	// when IP
    	if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
    		$template = 'classic';
    	}
    
    	// when User_Level (example: Admin -> level_10)
    	// see http://codex.wordpress.org/Roles_and_Capabilities#Roles
    	if (current_user_can('level_10')) {
    		$template = 'test-theme';
    	}
    
    	return $template;
    }
    
    add_filter('template', 'fb_user_theme');
    add_filter('stylesheet', 'fb_user_theme');
    
    ?>
  4. whistler2020
    Member
    Posted 6 years ago #

    I think you misunderstood the instructions....
    the part that needs to be changed comes after ==

    // when Profil-ID
    	// see in backend exmaple.org/wp-admin/users.php
    	if (get_profile('ID') == 1) {
    		$template = 'default';
    	}

    change the 1 to the user id for the template 'default' where default is the requested template

    // when IP
    	if ($_SERVER['REMOTE_ADDR'] == 127.0.0.1 {
    		$template = 'classic';
    	}

    change the 127.0.0.1 to the IP of the person you want to match if you are going to use IP...same goes with $template here

Topic Closed

This topic has been closed to new replies.

About this Topic