2017 © Pedro Peláez
 

library switch_theme

Class for switch WordPress theme

image

megumi/switch_theme

Class for switch WordPress theme

  • Friday, November 8, 2013
  • by miya0001
  • Repository
  • 1 Watchers
  • 0 Stars
  • 176 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Megumi_SwitchTheme() Class

Class for switch WordPress theme., (*1)

How to install in your project.

Add composer.json like below

{
    "require": {
        "megumi/switch_theme": "dev-master"
    }
}

Download this package in your project.

composer install

Load this class.

require(dirname(__FILE__).'/vendor/autoload.php');

Example

Basic:, (*2)

<?php
/*
Plugin Name: Switch Theme
*/

require(dirname(__FILE__).'/vendor/autoload.php');

if (isset($_GET['test']) && $_GET['test']) {
    $theme = new Megumi_SwitchTheme('my-mobile-theme');
    $theme->apply();
}

Theme file is out of the wp-content/themes, (*3)

<?php
/*
Plugin Name: Switch Theme
*/

require(dirname(__FILE__).'/vendor/autoload.php');

if (isset($_GET['test']) && $_GET['test']) {
    $theme = new Megumi_SwitchTheme(
        'my-mobile-theme',
        '/path/to/wp-content/mobile-themes',
        'http://example.com/wp-content/mobile-themes'
    );
    $theme->apply();
}

License

GPL2, (*4)

The Versions

08/11 2013

dev-master

9999999-dev

Class for switch WordPress theme

  Sources   Download

GPL2

The Requires

  • php >=5.3

 

wordpress theme