Skip to content

Instantly share code, notes, and snippets.

@logoscreative
Created March 27, 2014 11:00
Show Gist options
  • Save logoscreative/9805028 to your computer and use it in GitHub Desktop.
Save logoscreative/9805028 to your computer and use it in GitHub Desktop.
Preview Genesis Child Theme Color Options
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