Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: zed1.com Theme switcher
- Plugin URI: http://zed1.com/
- Description: A plugin that switches themes based on the URI
- Version: 0.0.1
- Author: Mike Little
- Author URI: http://zed1.com/
- License: GPL2+
- */
- $z1_which_stylesheet = 'twentyeleven';
- $z1_which_template = 'twentyeleven';
- add_action('setup_theme', 'z1_determine_theme');
- function z1_determine_theme() {
- global $z1_which_stylesheet, $z1_which_template;
- if ( isset( $_SERVER['REQUEST_URI'] ) && ( false !== strpos( $_SERVER['REQUEST_URI'], '/shop/' ) ) ) {
- $z1_which_stylesheet = 'twentyten';
- $z1_which_template = 'twentyten';
- }
- }
- add_filter('stylesheet', 'z1_change_the_stylesheet');
- function z1_change_the_stylesheet($stylesheet) {
- global $z1_which_stylesheet;
- return $z1_which_stylesheet;
- }
- add_filter('template', 'z1_change_the_template');
- function z1_change_the_template($template) {
- global $z1_which_template;
- return $z1_which_template;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement