Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #35 from szk11001/master
Add theme stylesheet options in customizer
  • Loading branch information
amb00010 committed Dec 23, 2014
2 parents ec71765 + c0d2c32 commit ce40282
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 90 deletions.
107 changes: 17 additions & 90 deletions functions.php
Expand Up @@ -5,17 +5,6 @@
*
*/

// any custom js or css

function sherman_scripts() {
wp_enqueue_script( 'sherman-js', get_stylesheet_directory_uri() . '/javascripts/min/sherman.min.js', array( 'jquery' ));
}

add_action( 'wp_enqueue_scripts', 'sherman_scripts');




// Remove the Header Image Feature

function sherman_remove_theme_features() {
Expand All @@ -26,106 +15,44 @@ function sherman_remove_theme_features() {
add_action( 'init', 'sherman_remove_theme_features' );

function sherman_customize_register( $wp_customize ) {
$wp_customize->remove_section('colors');
//$wp_customize->remove_section('colors');
$wp_customize->remove_section('background_image');
$wp_customize->remove_section('nav');
}
add_action( 'customize_register', 'sherman_customize_register' );






// Add Options for Sherman-specific Color options.
/*

function sherman_titlebar_register( $wp_customize ){

$wp_customize->add_setting( 'titlebarColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
$wp_customize->add_setting( 'themeColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
array(
'default' => 'lightgrey', //Default setting/value to save
'default' => 'sherman-default', //Default setting/value to save
'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'?
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting.
'transport' => 'refresh'
)
);
$wp_customize->add_control('titlebarColor', array(
$wp_customize->add_control('themeColor', array(
'type' => 'radio',
'label' => 'Titlebar Color',
'label' => 'Stylesheet',
'section' => 'colors',
'choices' => array(
'blue'=>'Blue',
'red'=>'Red',
'black' => 'Black',
'darkgrey' => 'Dark Grey',
'lightgrey' => 'Light Grey',
'white' => 'White'
)
)
);
$wp_customize->add_setting( 'navColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
array(
'default' => 'lightgrey', //Default setting/value to save
'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'?
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting.
'transport' => 'refresh'
)
);
$wp_customize->add_control('navColor', array(
'type' => 'radio',
'label' => 'Navigation Color',
'section' => 'colors',
'choices' => array(
'blue'=>'Blue',
'red'=>'Red',
'black' => 'Black',
'darkgrey' => 'Dark Grey',
'lightgrey' => 'Light Grey',
'white' => 'White'
)
)
);
$wp_customize->add_setting( 'contentColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
array(
'default' => 'standard', //Default setting/value to save
'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'?
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting.
'transport' => 'refresh'
)
);
$wp_customize->add_control('contentColor', array(
'type' => 'radio',
'label' => 'Text Colors',
'section' => 'colors',
'choices' => array(
'standard'=>'Standard',
'reverse'=>'Reverse'
)
)
);
$wp_customize->add_setting( 'footColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
array(
'default' => 'lightgrey', //Default setting/value to save
'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'?
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting.
'transport' => 'refresh'
)
);
$wp_customize->add_control('footColor', array(
'type' => 'radio',
'label' => 'Footer Color',
'section' => 'colors',
'choices' => array(
'blue'=>'Blue',
'red'=>'Red',
'black' => 'Black',
'darkgrey' => 'Dark Grey',
'lightgrey' => 'Light Grey',
'white' => 'White'
'sherman-default' => 'Sherman Default',
'sherman-red' => 'Sherman Red',
'sherman-black' => 'Sherman Black',
)
)
);
}
add_action( 'customize_register', 'sherman_titlebar_register' , 34);
*/

function sherman_scripts() {
wp_enqueue_script( 'sherman-js', get_stylesheet_directory_uri() . '/javascripts/min/sherman.min.js', array( 'jquery' ));
$stylesheet = get_theme_mod('themeColor');
wp_enqueue_style( $stylesheet, get_stylesheet_directory_uri() . '/stylesheets/'.$stylesheet.'.css', array('cs-style') );
}

add_action( 'wp_enqueue_scripts', 'sherman_scripts');
?>
3 changes: 3 additions & 0 deletions stylesheets/sherman-default.css
@@ -0,0 +1,3 @@
/*
Sample css file, just to check if customizer stylesheet picking works
*/

0 comments on commit ce40282

Please sign in to comment.