Would it be possible to use this to set a default theme for a role?
I have multiple memberships and a few of them allow one (1) website credit. So if a member joins they’re able to create a website.
Scenario:
– I use a replicator plugin to assign a default website for users of Membership A.
– If a user upgrades to Membership B I need for them to be assigned another default theme.
Would I be able to use this plugin to set this default theme?
Any responses appreciated
]]>Can I open the page with the parameters in a new window?
function my_conditional_themes_setup() {
Conditional_Themes_Manager::register( ‘loose’, function() {
global $is_IE;
return (bool) $is_IE;
} );
}
add_action( ‘plugins_loaded’, ‘my_conditional_themes_setup’, 100 );
How to save this function so that it opens in a new window and in every browser?
]]>Hello – could this be used to allow an admin to turn on a different theme for them only. Perhaps a checkbox on the admin bar for them to turn it on?
]]>Hi – great plugin! Thanks ??
I am trying to change the theme depending on the referring URL, but after they navigate away from the landing page, it reverts to the original theme. I have added persistent mode but this then changes the theme for all visitors. Is there a way of using cookies or something similar to keep the theme while they visit different pages if they came from one referrer, but without resetting the main theme?
Thanks!
]]>Hello:
Is possible switch to a light theme on high server CPU loads using another plugin like “Ressources” whirch generates an average of server charge each 1, 5 or 15 minutes?
Thank you.
Can I show a different theme from detect referrer. example: from facebook
]]>How do I add a link in the footer of my mobile theme to load the desktop version of the theme.
]]>For example,
Show theme X if the viewer has a user role of “administrator”, Contributor” and “editor” and the page URI pattern is page-name or page-name-2 or page-name-3″
Otherwise, show original theme.
Also, are there wildcards allowed for URI? so instead of saying page-name-1 and page-name-2 we could just say:
Show x theme for page-name/*
This would help in keeping us from having to type out all the page names to switch the theme on that started out with a certain pattern.
Let me know – great idea for a plugin.
]]>Hi,
Really really like the plugin, its coded really nicely, i just need some help if possible.
I’m using Kirki Theme Customizer plugin to replace the standard WordPress Theme customizer.
Below is the Kirki Code i’m using and would just like to know like to know if i can change a theme based on the selection of a radio button.
The Separate themes are included in /framework/views/theme1
/**
* Choose a base theme
*/
function chunk_fields( $fields ) {
$fields[] = array(
'type' => 'radio',
'setting' => 'radio_demo',
'label' => __( 'Choose Your Base Theme', 'test' ),
'description' => __( 'Endless ways to create a website with ease', 'test' ),
'help' => __( 'There will be a new base theme created every 6 months.', 'test' ),
'section' => 'chunk',
'default' => 'option-1',
'priority' => 10,
'choices' => array(
'option-1' => __( 'Theme 1', 'test' ),
'option-2' => __( 'Theme 2', 'test' ),
/*This is where to add more themes in*/
),
);
return $fields;
}
add_filter( 'kirki/fields', 'chunk_fields' );
Any help would be much appreciated.
All the best
Thanks Jake.
]]>Can I show a different child theme per user group? Say username 204893 will see techone child theme, but username 45868 will see the beatchild child theme.
]]>HI There..
Like your plugin
Is there a way to change theme on the name of a single category used in a post.
So lets say i have post with 3 categeroy’s (cat1 cat2 cat3)attached but want to change theme if one of them is cat2
If cat2 doesn’t exist i don’t want to change the theme..
I have fiddelt around with the code but can’t get it working.
]]>I’m getting this error:
Parse error: syntax error, unexpected T_FUNCTION in /home1/mysite/public_html/wp-content/plugins/myplugin.php_/myplugin.php on line 22
The code I used in mu plugin is:
<?php
/**
* Plugin Name: thainewwest
* Plugin URI: https://URI_Of_Page_Describing_Plugin_and_Updates
* Description: Theme Switching plugin conditions. Can be erased when Moonrise is set to theme.
* Version: The plugin's version number. Example: 1.0.0
* Author: Name of the plugin author
* Author URI: https://URI_Of_The_Plugin_Author
* Text Domain: Optional. Plugin's text domain for localization. Example: mytextdomain
* Domain Path: Optional. Plugin's relative directory path to .mo files. Example: /locale/
* Network: Optional. Whether the plugin can only be activated network wide. Example: true
* License: A short license name. Example: GPL2
*/
add_action( 'plugins_loaded', 'my_conditional_themes_setup', 150 );
function my_conditional_themes_setup() {
// Switch to Twenty Thirteen theme if the user has administrator role.
Conditional_Themes_Manager::register( 'moonrise', function() {
return current_user_can( 'administrator' );
} );
}
Line 22 is Conditional_Themes_Manager::register( 'moonrise', function() {
The theme moonrise is installed, and Conditional Themes has been activated.
I tried the same setup in my local machine (MAMP), and it works there fine, but on the actual site, I get the error.
I uninstalled all other plugins, and it’s still not working.
Any ideas?
]]>Hi there,
Using Code Snippets and Conditional Themes I expected I could switch themes using the following:
// Switch to Twenty Sixteen theme when we being on page_id.
Conditional_Themes_Manager::register( ‘twentyten’, function() {
$id = get_the_ID();
return ( $id== “153”);
} );
Other switches does work ,like
// Switch to Twenty Sixteen theme when we being on 2015.
Conditional_Themes_Manager::register( ‘twentyten’, function() {
return ( date( ‘Y’ ) == 2015 );
} );
But the switch based on the page id does not.
How can I get this to work properly?
I also tried with code like
global $wp_query;
$postID = $wp_query->post->ID;
return ( $postID == 153 );
but it does not seems to listen to me ??
I’m trying to figure out how to switch themes based on the user’s login ID (not the user number). Here’s what I have been trying but I can’t seem to get it to work. Would someone glance at this and tell me what I need to change?
add_action( 'plugins_loaded', 'my_conditional_themes_setup', 100 );
function my_conditional_themes_setup() {
//Switch to channel66 theme if user ID matches
Conditional_Themes_Manager::register( 'channel66', function() {
get_currentuserinfo();
return ( $current_user->user_login === '7ff6xi' );
} );
}
Thanks,
-Norm
Can I show a different theme per user group? Say user ID 3,4,7,8 will see twentyfourteen but user ID 5,6,9 will see twentyfifteen
]]>I’m having trouble with the changed theme getting the old theme’s theme_mods (sidebar setup).
It appears that all the widgets are supplied by plugins, which load first, and then the theme switch filters are added. The filters are before the theme loads, but the sidebar names are based on the old theme?
I wondered if I merged my code with this plugin’s code, I could have it active before the end of the plugins_loaded time. My theme switch is done based on REQUEST variables, so I can check those really early.
Do you see another way to make sure the right theme_mods are used?
Great API, bit I can’t get it to work with my own plugin. What am I doing wrong? (if I echo the $department it is showing the right value that should make $go true, but the theme is not switched)
// Switch to Twenty Eleven theme if the visitor is from a certain department
Conditional_Themes_Manager::register( 'twentyeleven', function() {
// Get info
$user = wp_get_current_user();
$user_id = $user->ID;
$department = get_cimyFieldValue($user_id,"AFDELING");
if ($department == "Department X") {
$go = true;
} else {
$go = false;
}
return (bool) $go;
} );</blockquote>
]]>
Hello!
I am using now an old-fashioned theme which I want to replace in the near future.
But I want to have the old entries still being seen with the old layout.
Is it possible with this plugin to set a date (like 2014-03-31) and that all postings which have been published before will have another theme than the (then new) standard theme?
And is it somehow possible to override the date setting (perhaps through a custom value like newtheme=yes)?
]]>Can I show a different theme on only a certain username? There are several administrators but I want only one of them to see a different theme.
]]>The instructions are very unclear on how to use this plugin.
Where should it be called, where is it used? What file is best to call it from?