Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Forked from vbk/TE-modification
Created July 27, 2011 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kovshenin/1109725 to your computer and use it in GitHub Desktop.
Save kovshenin/1109725 to your computer and use it in GitHub Desktop.
Code used in functions.php
<?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