How to load a different theme for categories?

Ok, after some consideration and tinkering I could get it to work. The reason it wasn’t working was because the needed procedures for loading a template kick in long before the the parser gets to functions.php of the theme. So to overcome this I had to bring the code into the plugins’ section. By creating … Read more

Styleswitcher or themeswitcher to allow user to switch back to standard view from mobile device

Wouldn’t it be enough to switch mobile/desktop via a $_SESSION variable, make the “switch to desktop link” include something like ?switchtodesktop=1 and have the header contain something like session_start(); if ($_GET[‘switchtodesktop’]) { $_SESSION[‘switchtodesktop’] = true; } $desktop = isset($_SESSION[‘switchtodesktop’]); […] if ($desktop) { // only desktop css without media queries } else { // default … Read more

Change site template from php

If I understand your question, you should use this inside your foreach: $argument_to_pass_to_switch_theme = $theme->get_stylesheet(); Just taking a look at the documentation: The function wp_get_themes()… “…returns an array of WP_Theme objects based on the argument.” This class WP_Theme has a method get_stylesheet(), which… “…returns a string with the directory name of the theme’s “stylesheet” files, … Read more

Display a different theme for not logged-in users

Try hooking on all these: (But I guess you’d have to do it from a plugin, since doing it from theme functions.php might be too late). E.g.: /* Plugin Name: test Description: switchtest Version: 0.1.0 */ add_filter( ‘template’, ‘yourthing_switch_theme’ ); add_filter( ‘option_template’, ‘yourthing_switch_theme’ ); add_filter( ‘option_stylesheet’, ‘yourthing_switch_theme’ ); add_filter( ‘pre_option_stylesheet’, ‘yourthing_switch_theme’ ); function yourthing_switch_theme( $theme … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)