add_section( 'blackboard_lite_section_general', array( 'title' => __('General Settings','blackboard_lite'), 'description' => __('This controls various general theme settings.','blackboard_lite'), 'priority' => 5, ) ); $wp_customize->add_section( 'blackboard_lite_section_homepage', array( 'title' => __('Homepage Settings','blackboard_lite'), 'description' => __('This controls various homepage theme settings.','blackboard_lite'), 'priority' => 25, ) ); $wp_customize->add_section( 'blackboard_lite_section_fonts', array( 'title' => __('Color Settings','blackboard_lite'), 'description' => __('Customize some basic theme colors.','blackboard_lite'), 'priority' => 35, ) ); $wp_customize->add_setting( 'blackboard_lite_logo_upload', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'file-upload', array( 'label' => __('Logo File Upload','blackboard_lite'), 'section' => 'blackboard_lite_section_general', 'settings' => 'blackboard_lite_logo_upload' ) ) ); $wp_customize->add_setting( 'blackboard_lite_alt_logo_upload', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'alt-file-upload', array( 'label' => __('Footer Logo File Upload','blackboard_lite'), 'section' => 'blackboard_lite_section_general', 'settings' => 'blackboard_lite_alt_logo_upload' ) ) ); $copyright_default = __('Copyright © ','blackboard_lite') . date("Y",time()) . ' ' . get_bloginfo('name') . '. ' . __('All Rights Reserved', 'blackboard_lite'); $wp_customize->add_setting( 'blackboard_lite_copyright_text', array( 'default' => $copyright_default, 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_control( 'blackboard_lite_copyright_text', array( 'label' => __('Copyright text in Footer','blackboard_lite'), 'section' => 'blackboard_lite_section_general', 'type' => 'text', ) ); $wp_customize->add_setting( 'blackboard_lite_display_slideshow', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_html', 'default' => '0', )); $wp_customize->add_control( 'blackboard_lite_display_slideshow', array( 'label' => __('Display Slideshow', 'blackboard_lite'), 'section' => 'blackboard_lite_section_homepage', 'type' => 'checkbox', )); $wp_customize->add_setting( 'blackboard_lite_slideshow_number', array( 'default' => '5', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_control( 'blackboard_lite_slideshow_number', array( 'label' => __('Number of Images to Display','blackboard_lite'), 'section' => 'blackboard_lite_section_homepage', 'type' => 'text', ) ); $wp_customize->add_setting( 'blackboard_lite_bgcolor_header', array( 'default' => 'e8dfd6', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_bgcolor_header', array( 'label' => __('Header background color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_bgcolor_header', 'priority' => 1, ) ) ); $wp_customize->add_setting( 'blackboard_lite_bordercolor_header', array( 'default' => '6f000d', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_bordercolor_header', array( 'label' => __('Header bottom border color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_bordercolor_header', 'priority' => 2, ) ) ); $wp_customize->add_setting( 'blackboard_lite_bgcolor_menu', array( 'default' => '6f000d', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_bgcolor_menu', array( 'label' => __('Menu background color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_bgcolor_menu', 'priority' => 3, ) ) ); $wp_customize->add_setting( 'blackboard_lite_color_body', array( 'default' => '555555', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_color_body', array( 'label' => __('Main body text color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_color_body', 'priority' => 4, ) ) ); $wp_customize->add_setting( 'blackboard_lite_color_link', array( 'default' => '26bcd7', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_color_link', array( 'label' => __('Main body anchor(link) color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_color_link', ) ) ); $wp_customize->add_setting( 'blackboard_lite_color_link_hover', array( 'default' => 'e21735', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackboard_lite_color_link_hover', array( 'label' => __('Main body anchor(link) :hover color','blackboard_lite'), 'section' => 'blackboard_lite_section_fonts', 'settings' => 'blackboard_lite_color_link_hover', ) ) ); } add_action( 'customize_register', 'blackboard_lite_customizer' ); function blackboard_lite_sanitize_integer( $input ) { if( is_numeric( $input ) ) { return intval( $input ); } }