WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Conditional Themes

A simple API to switch the themes on certain conditions.

Important Notes:

  1. This plugin is for developers, not general users.

Conditional Themes is an API to switch the themes on certain conditions. This plugin doesn't have a GUI yet, I will design it if the users need it!

Basic Examples

You can use this plugin in many ways depending on your needs, this examples only for learning purposes:

// 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' );

Contributing

If you love this plugin and want to make it better:

https://github.com/nash-ye/WP-Conditional-Themes

Requires: 3.4 or higher
Compatible up to: 3.7.1
Last Updated: 2013-10-19
Downloads: 438

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1
50,2,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1