get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->add_setting('color_scheme', array( 'default' => '#ffa200', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'color_scheme',array( 'label' => __('Color Scheme','bread-and-cake'), 'description' => __('Select color from here.','bread-and-cake'), 'section' => 'colors', 'settings' => 'color_scheme' )) ); $wp_customize->add_setting('topbar-color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'topbar-color',array( 'description' => __('Select background color for topbar.','bread-and-cake'), 'section' => 'colors', 'settings' => 'topbar-color' )) ); $wp_customize->add_setting('headerbg-color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'headerbg-color',array( 'description' => __('Select background color for header.','bread-and-cake'), 'section' => 'colors', 'settings' => 'headerbg-color' )) ); $wp_customize->add_setting('footer-color', array( 'default' => '#2b2b2b', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'footer-color',array( 'description' => __('Select background color for footer.','bread-and-cake'), 'section' => 'colors', 'settings' => 'footer-color' )) ); // Slider Section Start $wp_customize->add_section( 'slider_section', array( 'title' => __('Slider Settings', 'bread-and-cake'), 'priority' => null, 'description' => __('Recommended image size (1420x567). Slider will work only when you select the static front page.','bread-and-cake'), ) ); $wp_customize->add_setting('page-setting7',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting7',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide one:','bread-and-cake'), 'section' => 'slider_section' )); $wp_customize->add_setting('page-setting8',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting8',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide two:','bread-and-cake'), 'section' => 'slider_section' )); $wp_customize->add_setting('page-setting9',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting9',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide three:','bread-and-cake'), 'section' => 'slider_section' )); $wp_customize->add_setting('hide_slider',array( 'default' => true, 'sanitize_callback' => 'bread_and_cake_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'hide_slider', array( 'settings' => 'hide_slider', 'section' => 'slider_section', 'label' => __('Check this to hide slider.','bread-and-cake'), 'type' => 'checkbox' )); // Slider Section End // Homepage Section Start $wp_customize->add_section( 'homepage_section', array( 'title' => __('Homepage Boxes', 'bread-and-cake'), 'priority' => null, 'description' => __('Select pages for homepage boxes. This section will be displayed only when you select the static front page.','bread-and-cake'), ) ); $wp_customize->add_setting('page-setting1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting1',array( 'type' => 'dropdown-pages', 'label' => __('Select page for first box:','bread-and-cake'), 'section' => 'homepage_section' )); $wp_customize->add_setting('page-setting2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting2',array( 'type' => 'dropdown-pages', 'label' => __('Select page for second box:','bread-and-cake'), 'section' => 'homepage_section' )); $wp_customize->add_setting('page-setting3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('page-setting3',array( 'type' => 'dropdown-pages', 'label' => __('Select page for third box:','bread-and-cake'), 'section' => 'homepage_section' )); $wp_customize->add_setting('hide_section',array( 'default' => true, 'sanitize_callback' => 'bread_and_cake_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'hide_section', array( 'settings' => 'hide_section', 'section' => 'homepage_section', 'label' => __('Check this to hide section.','bread-and-cake'), 'type' => 'checkbox' )); // Contact Section $wp_customize->add_section( 'contact_section', array( 'title' => __('Topbar Info', 'bread-and-cake'), 'priority' => null, 'description' => __('Add your topbar info here.','bread-and-cake'), ) ); $wp_customize->add_setting('address-txt',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('address-txt',array( 'type' => 'text', 'label' => __('Add address here.','bread-and-cake'), 'section' => 'contact_section' )); $wp_customize->add_setting('phone-txt',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('phone-txt',array( 'type' => 'text', 'label' => __('Add phone number here.','bread-and-cake'), 'section' => 'contact_section' )); $wp_customize->add_setting('time-txt',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('time-txt',array( 'type' => 'text', 'label' => __('Add working hours here.','bread-and-cake'), 'section' => 'contact_section' )); /* ------- Social icons ------- */ $wp_customize->add_setting('facebook',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('facebook',array( 'type' => 'text', 'label' => __('Add facebook link here.','bread-and-cake'), 'section' => 'contact_section' )); $wp_customize->add_setting('twitter',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('twitter',array( 'type' => 'text', 'label' => __('Add twitter link here.','bread-and-cake'), 'section' => 'contact_section' )); $wp_customize->add_setting('gplus',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('gplus',array( 'type' => 'text', 'label' => __('Add google plus link here.','bread-and-cake'), 'section' => 'contact_section' )); $wp_customize->add_setting('linkedin',array( 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('linkedin',array( 'type' => 'text', 'label' => __('Add linkedin link here.','bread-and-cake'), 'section' => 'contact_section' )); } add_action( 'customize_register', 'bread_and_cake_customize_register' ); function bread_and_cake_css(){ ?>