Plugin info

Total downloads: 4,556
Active installs: 50
Total reviews: 9
Average rating: 4.9
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 2
Last updated: 7/19/2019 (2355 days ago)
Added to WordPress: 10/19/2013 (12 years old)
Minimum WordPress version: 3.4
Tested up to WordPress version: 5.2.23
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 2355 days ago • 9 reviews

22/100

Is Conditional Themes abandoned?

Possibly abandoned (last update 2355 days ago).

Compatibility

Requires WordPress: 3.4
Tested up to: 5.2.23
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Theme Switcha – Easily Switch Themes for Development and Testing
Rating 4.4/5 (61 reviews)Active installs 7,000
Mobile Smart
Rating 4.6/5 (9 reviews)Active installs 1,000
IJM Theme Switcher Bar
Rating 4.8/5 (9 reviews)Active installs 10
Parallels Themes Switcher
Rating 5.0/5 (1 reviews)Active installs 10
JP Theme Switcher Bar
Rating 5.0/5 (1 reviews)Active installs 10
User Level Themes
Rating 0.0/5 (0 reviews)Active installs 10

Description

Conditional Themes is an API to switch the themes on certain conditions.

Usage

Write an another plugin file and use the Conditional Themes API as the example below:

add_action('plugins_loaded', 'my_conditional_themes_setup', 100);

function my_conditional_themes_setup()
{
    // Switch to Twenty Eleven theme if the visitor use Internet Explorer.
    Conditional_Themes_Manager::register('twentyeleven', function() {
        global $is_IE;
        return (bool) $is_IE;
    });

    // Switch to Twenty Thirteen theme if the user has administrator role.
    Conditional_Themes_Manager::register('twentythirteen', function() {
        return current_user_can('administrator');
    });

    // Switch to a custom theme if the visitor use a mobile device.
    Conditional_Themes_Manager::register('mobile', 'wp_is_mobile');
}

Another example, With enabling persistent mode.

add_action('plugins_loaded', 'my_conditional_themes_setup', 100);

function my_conditional_themes_setup()
{
    // Enable the switcher persistent mode.
    Conditional_Themes_Manager::set_option('persistent', true);

    // Switch to Twenty Sixteen theme when we being on 2016.
    Conditional_Themes_Manager::register('twentysixteen', function() {
        return (date('Y') == 2016);
    });

    // Switch to Twenty Fifteen theme when the site reaches 500 post.
    Conditional_Themes_Manager::register('twentyfifteen', function() {
        return ((int) wp_count_posts() > 500);
    });
}

Note: You can use Code Snippets plugin to add the code snippets to your site.

Contributing

Developers can contribute to the source code on the Github Repository.

Installation

  1. Upload and install the plugin
  2. Use the plugin API to powerful your project.

Frequently Asked Questions

No FAQ available

Review feed

Dipak Kumar Pusti
11/16/2017

Awesome Plugin. Neat and Accurate

Keep up the good work. Plugin exactly doing what it should do. Perfect :)

Screenshots

No screenshots available

Changelog

0.6

  • Better code style formatting.

0.4

  • Fix updating switched theme sidebars widgets bug, props @Offereins.
  • Better classes and code organization.

0.4

  • Fix the switched theme sidebars widgets bug, props @joyously.
  • Better functions names and code organization.

0.3

  • Add a new feature allow to switch the themes persistently.
  • Improve the performance by excluding the original theme from being switched.

0.2

  • Cleaner code and minor fixes.

0.1

  • The Initial version.