get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; // ============================= // = Genral Settings = // ============================= $wp_customize->get_section('title_tagline')->title = esc_html__('General Settings', 'blogangellite'); $wp_customize->get_section('title_tagline')->priority = 3; //Logo upload $wp_customize->add_setting('logo_upload', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blogangellite_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'logo_upload', array( 'label' => __('Logo Upload', 'blogangellite'), 'section' => 'title_tagline', 'settings' => 'logo_upload', ))); // ============================= // = Home Post Slider Settings = // ============================= $wp_customize->add_section('slider_option', array( 'title' => __('Home Page Slider Options ', 'blogangellite'), 'priority' => 25, )); //= Choose All Category = $cats = array(); $cats[0] = 'All Categories'; foreach ( get_categories() as $categories => $category ){ $cats[$category->term_id] = $category->name; } $wp_customize->add_setting('slider_cate', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control('slider_cate', array( 'settings' => 'slider_cate', 'label' => __('Featured Post Category','blogangellite'), 'section' => 'slider_option', 'type' => 'select', 'choices' => $cats, ) ); $wp_customize->add_setting('slider_count', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control('slider_count', array( 'settings' => 'slider_count', 'label' => __('Number of Slides','blogangellite'), 'section' => 'slider_option', 'type' => 'number', 'input_attrs' => array('min' => 1,'max' => 3) ) ); // ============================= // = Home Page Settings = // ============================= $wp_customize->add_section('home_page', array( 'title' => __('Home Page Settings ', 'blogangellite'), 'priority' => 25, )); //= Choose Grid Layout = $wp_customize->add_setting('dynamic_grid', array( 'default' => 'standard-layout', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( 'dynamic_grid', array( 'settings' => 'dynamic_grid', 'label' => __('Choose Post Layout','blogangellite'), 'section' => 'home_page', 'type' => 'select', 'choices' => array( 'standard-layout' => __('Standard Layout','blogangellite'), 'two-grid-layout' => __('Two Grid','blogangellite'), ), )); // ============================= // = Social Settings = // ============================= $wp_customize->add_section('social_option', array( 'title' => __('Social Icon Options ', 'blogangellite'), 'priority' => 25, )); //= social Options = facebook $wp_customize->add_setting('f_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control('f_link', array( 'settings' => 'f_link', 'label' => __('Facebook Link:','blogangellite'), 'section' => 'social_option', 'type' => 'text', ) ); //google icon $wp_customize->add_setting('g_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control('g_link', array( 'settings' => 'g_link', 'label' => __('Google Link:','blogangellite'), 'section' => 'social_option', 'type' => 'text', ) ); //linkdin icon $wp_customize->add_setting('l_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control('l_link', array( 'settings' => 'l_link', 'label' => __('Linkedin Link:','blogangellite'), 'section' => 'social_option', 'type' => 'text', ) ); // ============================= // = Footer Settings = // ============================= $wp_customize->add_section('footer_option', array( 'title' => __('Footer Options ', 'blogangellite'), 'priority' => 25, )); $wp_customize->add_setting('copyright_textbox', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('copyright_textbox', array( 'settings' => 'copyright_textbox', 'label' => __('Copyright Text','blogangellite'), 'section' => 'footer_option', 'type' => 'text', ) ); // ============================= // = Custom CSS = // ============================= $wp_customize->add_section('custom_css', array( 'title' => __('Custom CSS', 'blogangellite'), 'priority' => 25, )); $wp_customize->add_setting('custom_css_text', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blogangellite_sanitize_textarea', )); $wp_customize->add_control('custom_css_text', array( 'settings' => 'custom_css_text', 'label' => __('Custom CSS','blogangellite'), 'section' => 'custom_css', 'type' => 'textarea', ) ); } add_action('customize_register','blogangellite_customize_register');