Created
August 9, 2014 00:07
-
-
Save MikeGillihan/594fa4c3442a5b7915fa to your computer and use it in GitHub Desktop.
Add ACF field Color Scheme Class
This file contains 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
/** | |
* Color Scheme | |
* Add color theme class to <body> | |
* Requires custom field 'color_scheme' | |
*/ | |
// add_filter('body_class', 'genesass_color_scheme'); | |
function genesass_color_scheme($classes) { | |
$color_scheme = get_field('color_scheme'); | |
if( !is_front_page() && !is_page( 'search' ) ) { | |
$classes[] = $color_scheme; | |
} else if( is_page( 'search' ) ) { | |
$classes[] = $color_scheme . ' search-page'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment