Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php
function prudence_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'themeColor', //Give it a SERIALIZED name (so all theme settings can live under one db record)
array(
'default' => 'blue', //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', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
)
);
$wp_customize->add_control('themeColor', array(
'type' => 'radio',
'label' => 'Theme Color',
'section' => 'huskypress_options',
'choices' => array(
'blue'=>'UConn Blue',
'olive' => 'Olive',
'red'=>'Red'
)
)
);
//$wp_customize->remove_setting('navoption1');
//$wp_customize->remove_setting('navoption2');
//$wp_customize->remove_control('navoption1');
//$wp_customize->remove_control('navoption2');
}
add_action( 'customize_register', 'prudence_customize_register', 11 );
function prudence_enqueue_styles() {
wp_register_style( 'prudenceBase', get_stylesheet_directory_uri() .'/style.css');
wp_register_style( 'prudenceBlue', get_stylesheet_directory_uri() .'/blue.css', prudenceBase);
wp_register_style( 'prudenceOlive', get_stylesheet_directory_uri() .'/olive.css');
wp_register_style( 'prudenceRed', get_stylesheet_directory_uri() .'/red.css');
wp_enqueue_style('prudenceBase');
$themeColor = get_theme_mod( 'themeColor','blue');
if($themeColor == 'blue') {
wp_enqueue_style('prudenceBlue');
} else if($themeColor == 'olive') {
wp_enqueue_style('prudenceOlive');
} else if($themeColor == 'red') {
wp_enqueue_style('prudenceRed');
};
};
add_action('wp_enqueue_scripts', 'prudence_enqueue_styles', 11);
?>