-
-
Save kovshenin/1109725 to your computer and use it in GitHub Desktop.
Code used in functions.php
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
<?php | |
/** Both color schemes **/ | |
add_filter( 'twentyeleven_color_schemes', 'twentyeleven_color_schemes_both' ); | |
add_action( 'twentyeleven_enqueue_color_scheme', 'twentyeleven_enqueue_color_scheme_both' ); | |
function twentyeleven_color_schemes_both( $color_schemes ) { | |
$color_schemes['orange'] = array( | |
'value' => 'orange', | |
'label' => __( 'Orange', 'twentyeleven' ), | |
'thumbnail' => get_stylesheet_directory_uri() . '/orange.png', | |
'default_link_color' => '#FFA500', | |
); | |
$color_schemes['green'] = array( | |
'value' => 'green', | |
'label' => __( 'Green', 'twentyeleven' ), | |
'thumbnail' => get_stylesheet_directory_uri() . '/green.png', | |
'default_link_color' => '#DEFF17' | |
); | |
return $color_schemes; | |
} | |
function twentyeleven_enqueue_color_scheme_both( $color_scheme ) { | |
if ( 'orange' == $color_scheme ) | |
wp_enqueue_style( 'orange', get_stylesheet_directory_uri() . '/orange.css', array(), null ); | |
elseif ( 'green' == $color_scheme ) | |
wp_enqueue_style( 'green', get_stylesheet_directory_uri() . '/green.css', array(), null ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment