get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->add_setting('color_scheme', array( 'default' => '#ffae00', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'color_scheme',array( 'label' => __('Color Scheme','decorator'), 'description' => __('Select color from here.','decorator'), 'section' => 'colors', 'settings' => 'color_scheme' )) ); $wp_customize->add_setting('topbar-color', array( 'default' => '#362b21', '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.','decorator'), '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.','decorator'), 'section' => 'colors', 'settings' => 'headerbg-color' )) ); // Slider Section Start $wp_customize->add_section( 'slider_section', array( 'title' => __('Slider Settings', 'decorator'), 'priority' => null, 'description' => __('Recommended image size (1420x567). Slider will work only when you select the static front page.','decorator'), ) ); $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:','decorator'), '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:','decorator'), '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:','decorator'), 'section' => 'slider_section' )); $wp_customize->add_setting('hide_slider',array( 'default' => true, 'sanitize_callback' => 'decorator_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.','decorator'), 'type' => 'checkbox' )); // Slider Section End // Homepage Section Start $wp_customize->add_section( 'homepage_section', array( 'title' => __('Homepage Boxes', 'decorator'), 'priority' => null, 'description' => __('Select pages for homepage boxes. This section will be displayed only when you select the static front page.','decorator'), ) ); $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:','decorator'), '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:','decorator'), '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:','decorator'), 'section' => 'homepage_section' )); $wp_customize->add_setting('hide_section',array( 'default' => true, 'sanitize_callback' => 'decorator_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.','decorator'), 'type' => 'checkbox' )); // Contact Section $wp_customize->add_section( 'contact_section', array( 'title' => __('Topbar Info', 'decorator'), 'priority' => null, 'description' => __('Add your topbar info here.','decorator'), ) ); $wp_customize->add_setting('email-txt',array( 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('email-txt',array( 'type' => 'text', 'label' => __('Add email address here.','decorator'), '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.','decorator'), 'section' => 'contact_section' )); } add_action( 'customize_register', 'decorator_customize_register' ); function decorator_css(){ ?>