add_setting('bizzy_logo_url', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'default' => get_template_directory_uri().'/img/bizzy-logo.png',
'type' => 'theme_mod',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'bizzy_logo_url', array(
'label' => __('Logo Image','bizzy'),
'section' => 'title_tagline',
'settings' => 'bizzy_logo_url'
)));
// COLORS
$wp_customize->add_setting('bizzy_primary_color', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '#1e73be'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bizzy_primary_color', array(
'label' => __( 'Primary Color', 'bizzy' ),
'section' => 'colors',
'settings' => 'bizzy_primary_color',
'priority' => 1
)));
$wp_customize->add_setting('bizzy_secondary_color', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '#FFFFFF'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bizzy_secondary_color', array(
'label' => __( 'Secondary Color', 'bizzy' ),
'section' => 'colors',
'settings' => 'bizzy_secondary_color',
'priority' => 1
)));
$wp_customize->add_setting('bizzy_primary_color', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
));
// END OF COLORS
$wp_customize->add_panel( 'slider_panel', array(
'priority' => 85,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Slider', 'bizzy'),
'description' => __('Several settings pertaining the slider', 'bizzy'),
));
$wp_customize->add_section('slider_settings_section',array(
'title' => __('Settings','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to change settings in your slider','bizzy'),
'panel' => 'slider_panel'
));
$wp_customize->add_setting('bizzy_slider_text_color', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bizzy_slider_text_color', array(
'label' => __( 'Slider Text Color', 'bizzy' ),
'section' => 'slider_settings_section',
'settings' => 'bizzy_slider_text_color'
)));
$wp_customize->add_setting('bizzy_show_slide_arrows', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'type' => 'theme_mod',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_show_slide_arrows', array(
'settings' => 'bizzy_show_slide_arrows',
'label' => __('Show Slider Arrows','bizzy'),
'section' => 'slider_settings_section',
'type' => 'checkbox',
)));
$wp_customize->add_setting('bizzy_show_slide_dots', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'type' => 'theme_mod',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_show_slide_dots', array(
'settings' => 'bizzy_show_slide_dots',
'label' => __('Show Slider Dot Navigations','bizzy'),
'section' => 'slider_settings_section',
'type' => 'checkbox',
)));
$wp_customize->add_setting('bizzy_autoplay_slide', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'type' => 'theme_mod',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_autoplay_slide', array(
'settings' => 'bizzy_autoplay_slide',
'label' => __('Autoplay Slider','bizzy'),
'section' => 'slider_settings_section',
'type' => 'checkbox',
)));
$wp_customize->add_setting('bizzy_autoplayspeed_slide', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '5000'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_autoplayspeed_slide', array(
'settings' => 'bizzy_autoplayspeed_slide',
'label' => __('Autoplay Speed (applied if autoplay is checked)','bizzy'),
'section' => 'slider_settings_section',
'type' => 'text',
)));
/*END OF SLIDERS PANEL*/
/*FEATURES PANEL*/
$wp_customize->add_panel( 'features_panel', array(
'priority' => 90,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Features', 'bizzy'),
'description' => __('Several settings pertaining the features section', 'bizzy'),
));
$wp_customize->add_section('features_content_section', array(
'title' => __('Settings','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to manage features section','bizzy'),
'panel' => 'features_panel'
));
$wp_customize->add_setting('bizzy_feature_title', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => 'What We Can Do'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_feature_title', array(
'settings' => 'bizzy_feature_title',
'label' => __('Feature Title ', 'bizzy'),
'section' => 'features_content_section',
'type' => 'text',
)));
$wp_customize->add_setting('bizzy_feature_subtitle', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => 'Lorem ipsum dolor sit amet'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_feature_subtitle', array(
'settings' => 'bizzy_feature_subtitle',
'label' => __('Feature Description ', 'bizzy'),
'section' => 'features_content_section',
'type' => 'textarea',
)));
/*END OF FEATURES PANEL*/
/*SITE DETAILS*/
$wp_customize->add_section('bizzy_details_section', array(
'title' => __('Company Details','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to update your company details','bizzy'),
'priority' => 95
));
$wp_customize->add_setting('bizzy_company_address', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => 'Mr. Juan C. Masipag
P.O. Box 1121, Araneta Center Post Office
1135 Quezon City, Metro Manila'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_company_address', array(
'settings' => 'bizzy_company_address',
'label' => __('Company Address', 'bizzy'),
'section' => 'bizzy_details_section',
'type' => 'textarea',
)));
$wp_customize->add_setting('bizzy_company_phones', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => "(123) - 456 7890
\r\n(098) - 765 4321",
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_company_phones', array(
'settings' => 'bizzy_company_phones',
'label' => __('Company Phone Numbers', 'bizzy'),
'section' => 'bizzy_details_section',
'type' => 'textarea',
)));
$wp_customize->add_setting('bizzy_site_emails', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => "admin@gmail.com
\r\ntester@yahoo.com"
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_site_emails', array(
'settings' => 'bizzy_site_emails',
'label' => __('Company Email Addresses', 'bizzy'),
'section' => 'bizzy_details_section',
'type' => 'textarea',
)));
/*END OF SITE DETAILS*/
/*TESTIMONIALS PANEL*/
$wp_customize->add_panel( 'testimonials_panel', array(
'priority' => 95.5,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Testimonials', 'bizzy'),
'description' => __('Several settings pertaining the testimonials section', 'bizzy'),
));
$wp_customize->add_section('testimonials_content_section', array(
'title' => __('Settings','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to change settings in your testimonials section','bizzy'),
'panel' => 'testimonials_panel'
));
$wp_customize->add_setting('bizzy_testi_title', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'default' => __('What They Say','bizzy'),
'type' => 'theme_mod',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_testi_title', array(
'settings' => 'bizzy_testi_title',
'label' => __('Title Text ', 'bizzy'),
'section' => 'testimonials_content_section',
'type' => 'text',
)));
$wp_customize->add_setting('bizzy_testi_bg', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'default' => get_template_directory_uri().'/img/testi-bg.jpg',
'type' => 'theme_mod',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'bizzy_testi_bg', array(
'label' => __('Background','bizzy'),
'section' => 'testimonials_content_section',
'settings' => 'bizzy_testi_bg'
)));
/*END OF TESTIMONIALS PANEL*/
/*BLOG SECTION*/
$wp_customize->add_section('blog_content_section', array(
'title' => __('Home Blog','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to update your blog details','bizzy'),
'priority' => 96
));
$wp_customize->add_setting('bizzy_blog_title', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => __('Latest News','bizzy')
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_blog_title', array(
'settings' => 'bizzy_blog_title',
'label' => __('Blog Title ', 'bizzy'),
'section' => 'blog_content_section',
'type' => 'text',
)));
$wp_customize->add_setting('bizzy_blog_subtitle', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => __('Latest news, events and happenings in our company','bizzy')
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_blog_subtitle', array(
'settings' => 'bizzy_blog_subtitle',
'label' => __('Blog Description ', 'bizzy'),
'section' => 'blog_content_section',
'type' => 'textarea',
)));
$wp_customize->add_setting('bizzy_disable_homeblog', array(
'type' => 'theme_mod',
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_disable_homeblog', array(
'settings' => 'bizzy_disable_homeblog',
'label' => __('Disable Home Blog Display','bizzy'),
'section' => 'blog_content_section',
'type' => 'checkbox',
)));
/*END OF BLOG SECTION*/
/*CALL TO ACTION SECTION*/
$wp_customize->add_section('cta_content_section', array(
'title' => __('Call to Action','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to set your call to action section','bizzy'),
'priority' => 97
));
$wp_customize->add_setting('bizzy_cta_title', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => __('Contact Us!','bizzy')
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_cta_title', array(
'settings' => 'bizzy_cta_title',
'label' => __('Title', 'bizzy'),
'section' => 'cta_content_section',
'type' => 'text',
)));
$wp_customize->add_setting('bizzy_cta_subtitle', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => __('For more information, feel free to send your queries to us.','bizzy')
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_cta_subtitle', array(
'settings' => 'bizzy_cta_subtitle',
'label' => __('Subtitle', 'bizzy'),
'section' => 'cta_content_section',
'type' => 'textarea',
)));
$wp_customize->add_setting('bizzy_cta_btn_text', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => __('Click Here','bizzy')
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_cta_btn_text', array(
'settings' => 'bizzy_cta_btn_text',
'label' => __('Button Text', 'bizzy'),
'section' => 'cta_content_section',
'type' => 'text',
)));
$wp_customize->add_setting('bizzy_cta_btn_url', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '#'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_cta_btn_url', array(
'settings' => 'bizzy_cta_btn_url',
'label' => __('Button URL', 'bizzy'),
'section' => 'cta_content_section',
'type' => 'text',
)));
/*END OF CALL TO ACTION SECTION*/
/*SOCIAL MEDIA*/
$wp_customize->add_section('sm_section', array(
'title' => __('Social Media','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to set your social media URLs','bizzy'),
'priority' => 99
));
$socials = array('facebook', 'twitter', 'linkedin', 'pinterest', 'googleplus', 'behance', 'dribbble', 'instagram');
for($i=0;$iadd_setting('bizzy_'.$socials[$i], array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '#'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'bizzy_'.$socials[$i], array(
'settings' => 'bizzy_'.$socials[$i],
'label' => $name.' URL',
'section' => 'sm_section',
'type' => 'text',
)));
}
/*END OF SOCIAL MEDIA*/
$wp_customize->add_panel( 'footer_panel', array(
'priority' => 98,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Footer', 'bizzy'),
'description' => __('Several settings pertaining the footer', 'bizzy'),
));
$wp_customize->add_section('footer_content', array(
'title' => __('Content','bizzy'),
'capability' => 'edit_theme_options',
'description' => __('Allows you to set your footer content','bizzy'),
'panel' => 'footer_panel'
));
$wp_customize->add_setting('sb_copyright', array(
'sanitize_callback' => 'bizzy_sanitize_customizer_val',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'default' => '© 2015 Copyright text goes here ',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'sb_copyright', array(
'settings' => 'sb_copyright',
'label' => __('Copyright Text','bizzy'),
'section' => 'footer_content',
'type' => 'textarea',
)));
}
add_action('customize_register', 'bizzy_customize_register');
function bizzy($name, $default = false) {
return get_theme_mod( $name, $default );
}
function bizzy_sanitize_customizer_val($value){
if (!filter_var($value, FILTER_VALIDATE_URL) === false) //check if URL
return esc_url_raw($value);
else
return sanitize_text_field($value);
}
add_action( 'wp_head','bizzy_custom_style' );
function bizzy_custom_style() {
?>