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', 'blogangel'); $wp_customize->get_section('title_tagline')->priority = 3; //Logo upload $wp_customize->add_setting('logo_upload', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blogangel_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'logo_upload', array( 'label' => __('Logo Upload', 'blogangel'), 'section' => 'title_tagline', 'settings' => 'logo_upload', ))); // ============================= // = Header Settings = // ============================= $wp_customize->add_section('header_scheme', array( 'title' => __('Header Settings', 'blogangel'), 'priority' => 25, )); //Menu Options $wp_customize->add_setting('menu_option', array( 'default' => 'floating', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control('menu_option', array( 'label' => __('Menu Options', 'blogangel'), 'section' => 'header_scheme', 'settings' => 'menu_option', 'type' => 'radio', 'choices' => array( 'floating' => 'Floating Menu', 'normal' => 'Normal Menu', ), )); // ============================= // = Home Post Slider Settings = // ============================= $wp_customize->add_section('slider_option', array( 'title' => __('Home Page Slider Options ', 'blogangel'), 'priority' => 25, )); //= Slider On Off = $wp_customize->add_setting('slider_on_off', array( 'default' => 'slider_on', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control('slider_on_off', array( 'settings' => 'slider_on_off', 'label' => __('Post Slider On/Off','blogangel'), 'section' => 'slider_option', 'type' => 'radio', 'choices' => array( 'slider_on' => 'On', 'slider_off' => 'Off', ), ) ); //= 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','blogangel'), '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','blogangel'), 'section' => 'slider_option', 'type' => 'number', 'input_attrs' => array('min' => 1,'max' => 10) ) ); // ============================= // = Home Page Settings = // ============================= $wp_customize->add_section('home_page', array( 'title' => __('Home Page Settings ', 'blogangel'), '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','blogangel'), 'section' => 'home_page', 'type' => 'select', 'choices' => array( 'standard-layout' => __('Standard Layout','blogangel'), 'two-grid-layout' => __('Two Grid','blogangel'), 'three-grid-layout' => __('Three Grid','blogangel'), 'list-layout' => __('List Layout','blogangel'), 'boxed-layout' => __('Boxed Layout','blogangel'), ), )); // = Choose Grid Layout = $wp_customize->add_setting('dynamic_sidebar', array( 'default' => 'no-sidebar', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( 'dynamic_sidebar', array( 'settings' => 'dynamic_sidebar', 'label' => __('Sidebar Options','blogangel'), 'section' => 'home_page', 'type' => 'radio', 'choices' => array( 'no-sidebar' => __('No Sidebar','blogangel'), 'left' => __('Left Sidbar','blogangel'), 'right' => __('Right Sidbar','blogangel'), ), )); // = Choose pagination = $wp_customize->add_setting('pagination', array( 'default' => 'number', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( 'pagination', array( 'settings' => 'pagination', 'label' => __('Pagination Type','blogangel'), 'section' => 'home_page', 'type' => 'radio', 'choices' => array( 'number' => __('Default (1,2,3,...)','blogangel'), 'load_more' => __('Ajax (Load More Button)','blogangel'), 'infinite_scroll'=> __('Ajax (Auto Infinite Scroll)','blogangel'), ), )); //= Choose Post Meta = $wp_customize->add_setting('home_post_meta', array( 'default' =>array(), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'th_checkbox_explode', )); $wp_customize->add_control(new TH_Customize_Control_Checkbox_Multiple( $wp_customize,'home_post_meta', array( 'settings' => 'home_post_meta', 'label' => __( 'Meta Info to Hide', 'blogangel' ), 'section' => 'home_page', 'choices' => array( 'category' => __('Hide Category', 'blogangel' ), 'date' => __('Hide Date', 'blogangel' ), 'comment' => __('Hide Comment','blogangel' ), ) ) ) ); // ============================= // = Single Post Settings = // ============================= $wp_customize->add_section('single_post_option', array( 'title' => __('Single Post Settings ', 'blogangel'), 'priority' => 25, )); $wp_customize->add_setting( 'single_social_share', array( 'default' => 'on','sanitize_callback' => 'esc_attr') ); $wp_customize->add_control('single_social_share', array( 'label' => __('Social Share Show/Hide', 'blogangel'), 'section' => 'single_post_option', 'settings' => 'single_social_share', 'type' => 'radio', 'choices' => array( 'on' => 'Show', 'off' => 'Hide', ), )); $wp_customize->add_setting('single_post_meta', array( 'default' =>array(), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'th_checkbox_explode' )); $wp_customize->add_control(new TH_Customize_Control_Checkbox_Multiple( $wp_customize,'single_post_meta', array( 'settings' => 'single_post_meta', 'label' => __( 'Single Post Meta Hide/Show', 'blogangel' ), 'section' => 'single_post_option', 'choices' => array( 'single_catgory' => __( 'Hide Category', 'blogangel' ), 'single_tag' => __( 'Hide Tag', 'blogangel' ), 'single_date' => __( 'Hide Date', 'blogangel' ), 'single_author' => __( 'Hide Author', 'blogangel' ), ) ) ) ); // ============================= // = Social Settings = // ============================= // on/off social icon $wp_customize->add_setting('footer_on_social', array( 'default' => 'social_on', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control('footer_on_social', array( 'settings' => 'footer_on_social', 'label' => __('Footer Social Icon Hide/Show','blogangel'), 'section' => __('social_option','blogangel'), 'type' => 'radio', 'choices' => array( 'social_on' => 'Show', 'social_off' => 'Hide', ), ) ); $wp_customize->add_section('social_option', array( 'title' => __('Social Icon Options ', 'blogangel'), '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:','blogangel'), '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:','blogangel'), '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:','blogangel'), 'section' => 'social_option', 'type' => 'text', ) ); //pintrest $wp_customize->add_setting('p_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control('p_link', array( 'settings' => 'p_link', 'label' => __('Pinterest Link:','blogangel'), 'section' => 'social_option', 'type' => 'text', ) ); //twitter $wp_customize->add_setting('t_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control('t_link', array( 'settings' => 't_link', 'label' => __('Twitter Link:','blogangel'), 'section' => 'social_option', 'type' => 'text', )); // ============================= // = Theme Styling color = // ============================= $wp_customize->add_section('color_option', array( 'title' => __('Theme Color Options', 'blogangel'), 'priority' => 25, )); //Menu Color $wp_customize->add_setting('menu_color', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'menu_color', array( 'label' => __('Menu Text Color', 'blogangel'), 'section' => 'color_option', 'settings' => 'menu_color', ))); //Menu Hover Color $wp_customize->add_setting('menu_hover_color', array( 'default' => '#87ceeb', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'menu_hover_color', array( 'label' => __('Menu Text Hover Color', 'blogangel'), 'section' => 'color_option', 'settings' => 'menu_hover_color', ))); //themecolor $wp_customize->add_setting('theme_color', array( 'default' => '#87ceeb', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'theme_color', array( 'label' => __('Theme Color', 'blogangel'), 'section' => 'color_option', 'settings' => 'theme_color', ))); //footer background color $wp_customize->add_setting('footer_background', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'footer_background', array( 'label' => __('Footer Background Color', 'blogangel'), 'section' => 'color_option', 'settings' => 'footer_background', ))); //footer text color $wp_customize->add_setting('footer_text', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'footer_text', array( 'label' => __('Footer Text Color', 'blogangel'), 'section' => 'color_option', 'settings' => 'footer_text', ))); // ============================= // = Footer Settings = // ============================= $wp_customize->add_section('footer_option', array( 'title' => __('Footer Options ', 'blogangel'), 'priority' => 25, )); // = Footer Layout = $wp_customize->add_setting('footer_layout', array( 'default' => 'footer-widget-4column-active', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( 'footer_layout', array( 'settings' => 'footer_layout', 'label' => __('Widget Layout','blogangel'), 'section' => 'footer_option', 'type' => 'radio', 'choices' => array( 'footer-widget-3column-active' => 'Three Widget', 'footer-widget-4column-active' => 'Four Widget', ), )); $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','blogangel'), 'section' => 'footer_option', 'type' => 'text', ) ); // ============================= // = Custom CSS = // ============================= $wp_customize->add_section('custom_css', array( 'title' => __('Custom CSS', 'blogangel'), 'priority' => 25, )); $wp_customize->add_setting('custom_css_text', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blogangel_sanitize_textarea', )); $wp_customize->add_control('custom_css_text', array( 'settings' => 'custom_css_text', 'label' => __('Custom CSS','blogangel'), 'section' => 'custom_css', 'type' => 'textarea', ) ); } add_action('customize_register','th_customize_register');