Created
March 27, 2014 11:00
-
-
Save logoscreative/9805028 to your computer and use it in GitHub Desktop.
Preview Genesis Child Theme Color Options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'body_class', 'yourtheme_preview_color' ); | |
| function yourtheme_preview_color($classes) { | |
| if ( isset($_GET['color']) && !empty($_GET['color']) ) { | |
| $current_theme = wp_get_theme(); | |
| $queried_theme = $current_theme->stylesheet; | |
| array_push( $classes, $queried_theme . '-' . $_GET['color'] ); | |
| } | |
| return $classes; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment