default ); } function home_guard_sanitize_checkbox( $checked ) { // Boolean check. return ( ( isset( $checked ) && true == $checked ) ? true : false ); } function home_guard_sanitize_phone_number( $phone ) { // sanitize phone return preg_replace( '/[^\d+]/', '', $phone ); } function home_guard_sanitize_excerptrange( $number, $setting ) { // Ensure input is an absolute integer. $number = absint( $number ); // Get the input attributes associated with the setting. $atts = $setting->manager->get_control( $setting->id )->input_attrs; // Get minimum number in the range. $min = ( isset( $atts['min'] ) ? $atts['min'] : $number ); // Get maximum number in the range. $max = ( isset( $atts['max'] ) ? $atts['max'] : $number ); // Get step. $step = ( isset( $atts['step'] ) ? $atts['step'] : 1 ); // If the number is within the valid range, return it; otherwise, return the default return ( $min <= $number && $number <= $max && is_int( $number / $step ) ? $number : $setting->default ); } function home_guard_sanitize_number_absint( $number, $setting ) { // Ensure $number is an absolute integer (whole number, zero or greater). $number = absint( $number ); // If the input is an absolute integer, return it; otherwise, return the default return ( $number ? $number : $setting->default ); } // Ensure is an absolute integer function home_guard_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } } $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.logo h1 a', 'render_callback' => 'home_guard_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.logo p', 'render_callback' => 'home_guard_customize_partial_blogdescription', ) ); //Panel for section & control $wp_customize->add_panel( 'home_guard_panelsettings', array( 'priority' => 4, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Home Guard Theme Settings', 'home-guard' ), ) ); $wp_customize->add_section('home_guard_layoutstyle',array( 'title' => __('Layout Style','home-guard'), 'priority' => 1, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_layoutoption',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_layoutoption', array( 'section' => 'home_guard_layoutstyle', 'label' => __('Check to Show Box Layout','home-guard'), 'description' => __('check for box layout','home-guard'), 'type' => 'checkbox' )); //Box Layout Options $wp_customize->add_setting('home_guard_colorscheme',array( 'default' => '#57b857', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'home_guard_colorscheme',array( 'label' => __('Color Scheme','home-guard'), 'section' => 'colors', 'settings' => 'home_guard_colorscheme' )) ); $wp_customize->add_setting('home_guard_menufontcolor',array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'home_guard_menufontcolor',array( 'label' => __('Navigation font Color','home-guard'), 'section' => 'colors', 'settings' => 'home_guard_menufontcolor' )) ); $wp_customize->add_setting('home_guard_menufontactivecolor',array( 'default' => '#57b857', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'home_guard_menufontactivecolor',array( 'label' => __('Navigation Hover/Active Color','home-guard'), 'section' => 'colors', 'settings' => 'home_guard_menufontactivecolor' )) ); //Header Contact details $wp_customize->add_section('home_guard_hdrcontactdetails',array( 'title' => __('Header Contact Details','home-guard'), 'priority' => null, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_emailid',array( 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('home_guard_emailid',array( 'type' => 'email', 'label' => __('enter email id here.','home-guard'), 'section' => 'home_guard_hdrcontactdetails' )); $wp_customize->add_setting('home_guard_phoneno',array( 'default' => null, 'sanitize_callback' => 'home_guard_sanitize_phone_number' )); $wp_customize->add_control('home_guard_phoneno',array( 'type' => 'text', 'label' => __('Enter phone number here','home-guard'), 'section' => 'home_guard_hdrcontactdetails', 'setting' => 'home_guard_phoneno' )); $wp_customize->add_setting('home_guard_topfblink',array( 'default' => null, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('home_guard_topfblink',array( 'label' => __('Add facebook link here','home-guard'), 'section' => 'home_guard_hdrcontactdetails', 'setting' => 'home_guard_topfblink' )); $wp_customize->add_setting('home_guard_toptwlink',array( 'default' => null, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('home_guard_toptwlink',array( 'label' => __('Add twitter link here','home-guard'), 'section' => 'home_guard_hdrcontactdetails', 'setting' => 'home_guard_toptwlink' )); $wp_customize->add_setting('home_guard_topinlink',array( 'default' => null, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('home_guard_topinlink',array( 'label' => __('Add linkedin link here','home-guard'), 'section' => 'home_guard_hdrcontactdetails', 'setting' => 'home_guard_topinlink' )); $wp_customize->add_setting('home_guard_topigramlink',array( 'default' => null, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('home_guard_topigramlink',array( 'label' => __('Add instagram link here','home-guard'), 'section' => 'home_guard_hdrcontactdetails', 'setting' => 'home_guard_topigramlink' )); $wp_customize->add_setting('home_guard_show_hdinfodetails',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_hdinfodetails', array( 'settings' => 'home_guard_show_hdinfodetails', 'section' => 'home_guard_hdrcontactdetails', 'label' => __('Check To show This Section','home-guard'), 'type' => 'checkbox' ));//Show Contact Details Sections //Frontpage Section $wp_customize->add_section( 'home_guard_frontslider_sections', array( 'title' => __('Frontapage Slider Sections', 'home-guard'), 'priority' => null, 'description' => __('Default image size for slider is 1400 x 670 pixel.','home-guard'), 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_frontslider_pge1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control('home_guard_frontslider_pge1',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide 1:','home-guard'), 'section' => 'home_guard_frontslider_sections' )); $wp_customize->add_setting('home_guard_frontslider_pge2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control('home_guard_frontslider_pge2',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide 2:','home-guard'), 'section' => 'home_guard_frontslider_sections' )); $wp_customize->add_setting('home_guard_frontslider_pge3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control('home_guard_frontslider_pge3',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slide 3:','home-guard'), 'section' => 'home_guard_frontslider_sections' )); //frontpage Slider Section //Slider Excerpt Length $wp_customize->add_setting( 'home_guard_excerpt_length_frontslider', array( 'default' => 15, 'type' => 'theme_mod', 'sanitize_callback' => 'home_guard_sanitize_excerptrange', ) ); $wp_customize->add_control( 'home_guard_excerpt_length_frontslider', array( 'label' => __( 'Slider Excerpt length','home-guard' ), 'section' => 'home_guard_frontslider_sections', 'type' => 'range', 'settings' => 'home_guard_excerpt_length_frontslider','input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('home_guard_frontslider_pge_btntext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_frontslider_pge_btntext',array( 'type' => 'text', 'label' => __('enter button name here','home-guard'), 'section' => 'home_guard_frontslider_sections', 'setting' => 'home_guard_frontslider_pge_btntext' )); // slider read more button text $wp_customize->add_setting('home_guard_show_frontslider_sections',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_frontslider_sections', array( 'settings' => 'home_guard_show_frontslider_sections', 'section' => 'home_guard_frontslider_sections', 'label' => __('Check To Show This Section','home-guard'), 'type' => 'checkbox' ));//Show Header Slider Settings //Three page Services Sections $wp_customize->add_section('home_guard_fix3page_sections', array( 'title' => __('Three Page Column Sections','home-guard'), 'description' => __('Select pages from the dropdown for three column sections','home-guard'), 'priority' => null, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_fix3page_column1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_fix3page_column1',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_fix3page_sections', )); $wp_customize->add_setting('home_guard_fix3page_column2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_fix3page_column2',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_fix3page_sections', )); $wp_customize->add_setting('home_guard_fix3page_column3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_fix3page_column3',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_fix3page_sections', )); $wp_customize->add_setting( 'home_guard_fix3pagecolumn_excerpt_length', array( 'default' => 0, 'type' => 'theme_mod', 'sanitize_callback' => 'home_guard_sanitize_excerptrange', ) ); $wp_customize->add_control( 'home_guard_fix3pagecolumn_excerpt_length', array( 'label' => __( 'four page box excerpt length','home-guard' ), 'section' => 'home_guard_fix3page_sections', 'type' => 'range', 'settings' => 'home_guard_fix3pagecolumn_excerpt_length','input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('home_guard_show_fix3page_sections',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_fix3page_sections', array( 'settings' => 'home_guard_show_fix3page_sections', 'section' => 'home_guard_fix3page_sections', 'label' => __('Check To Show This Section','home-guard'), 'type' => 'checkbox' ));//Show three page column sections //Best Solution For Security System Sections $wp_customize->add_section('home_guard_security_solution_system', array( 'title' => __('Best Solution For Security System Sections','home-guard'), 'description' => __('Select pages from the dropdown for Best Solution For Security System','home-guard'), 'priority' => null, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_securitysolution',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_securitysolution',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_security_solution_system', )); $wp_customize->add_setting( 'home_guard_securitysolution_excerpt_length', array( 'default' => 30, 'type' => 'theme_mod', 'sanitize_callback' => 'home_guard_sanitize_excerptrange', ) ); $wp_customize->add_control( 'home_guard_securitysolution_excerpt_length', array( 'label' => __( 'page excerpt length','home-guard' ), 'section' => 'home_guard_security_solution_system', 'type' => 'range', 'settings' => 'home_guard_securitysolution_excerpt_length','input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('home_guard_callustextfor2sec',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_callustextfor2sec',array( 'type' => 'text', 'label' => __('Enter call us text here','home-guard'), 'section' => 'home_guard_security_solution_system', 'setting' => 'home_guard_callustextfor2sec' )); $wp_customize->add_setting('home_guard_phonefor2sec',array( 'default' => null, 'sanitize_callback' => 'home_guard_sanitize_phone_number' )); $wp_customize->add_control('home_guard_phonefor2sec',array( 'type' => 'text', 'label' => __('Enter phone number here','home-guard'), 'section' => 'home_guard_security_solution_system', 'setting' => 'home_guard_phonefor2sec' )); $wp_customize->add_setting('home_guard_show_securitysolution',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_securitysolution', array( 'settings' => 'home_guard_show_securitysolution', 'section' => 'home_guard_security_solution_system', 'label' => __('Check To Show This Section','home-guard'), 'type' => 'checkbox' ));//Show Best Solution For Security System Sections //Six Column Circle Services Sections $wp_customize->add_section('home_guard_sixcolumnservices_sections', array( 'title' => __('Six Column Circle Services Sections','home-guard'), 'description' => __('Select pages from the dropdown for six column section','home-guard'), 'priority' => null, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg1',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg2',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg3',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg4',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg4',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg5',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg5',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting('home_guard_sixcolumnservices_pg6',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'home_guard_sanitize_dropdown_pages' )); $wp_customize->add_control( 'home_guard_sixcolumnservices_pg6',array( 'type' => 'dropdown-pages', 'section' => 'home_guard_sixcolumnservices_sections', )); $wp_customize->add_setting( 'home_guard_sixcolumnservices_excerpt_length', array( 'default' => 0, 'type' => 'theme_mod', 'sanitize_callback' => 'home_guard_sanitize_excerptrange', ) ); $wp_customize->add_control( 'home_guard_sixcolumnservices_excerpt_length', array( 'label' => __( 'excerpt length','home-guard' ), 'section' => 'home_guard_sixcolumnservices_sections', 'type' => 'range', 'settings' => 'home_guard_sixcolumnservices_excerpt_length','input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('home_guard_show_sixcolumnservices_sections',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_sixcolumnservices_sections', array( 'settings' => 'home_guard_show_sixcolumnservices_sections', 'section' => 'home_guard_sixcolumnservices_sections', 'label' => __('Check To Show This Section','home-guard'), 'type' => 'checkbox' ));//Show Six column page sections //Footer Sections $wp_customize->add_section('home_guard_footer_section', array( 'title' => __('Footer Section','home-guard'), 'description' => __('footer contact ingo','home-guard'), 'priority' => null, 'panel' => 'home_guard_panelsettings', )); $wp_customize->add_setting('home_guard_footlocationtext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_footlocationtext',array( 'type' => 'text', 'label' => __('Enter location text here','home-guard'), 'section' => 'home_guard_footer_section', 'setting' => 'home_guard_footlocationtext' )); $wp_customize->add_setting('home_guard_footaddress',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_footaddress',array( 'type' => 'text', 'label' => __('Enter footer address here','home-guard'), 'section' => 'home_guard_footer_section', 'setting' => 'home_guard_footaddress' )); $wp_customize->add_setting('home_guard_footmailustext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_footmailustext',array( 'type' => 'text', 'label' => __('Enter mail us text here','home-guard'), 'section' => 'home_guard_footer_section', 'setting' => 'home_guard_footmailustext' )); $wp_customize->add_setting('home_guard_footemailadd',array( 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('home_guard_footemailadd',array( 'type' => 'email', 'label' => __('enter email address for footer','home-guard'), 'section' => 'home_guard_footer_section' )); $wp_customize->add_setting('home_guard_footofficehrstext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_footofficehrstext',array( 'type' => 'text', 'label' => __('Enter office hrs text here','home-guard'), 'section' => 'home_guard_footer_section', 'setting' => 'home_guard_footofficehrstext' )); $wp_customize->add_setting('home_guard_footofficetiming',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('home_guard_footofficetiming',array( 'type' => 'text', 'label' => __('Enter office timing here','home-guard'), 'section' => 'home_guard_footer_section', 'setting' => 'home_guard_footofficetiming' )); $wp_customize->add_setting('home_guard_show_footer_section',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_show_footer_section', array( 'settings' => 'home_guard_show_footer_section', 'section' => 'home_guard_footer_section', 'label' => __('Check To Show This Section','home-guard'), 'type' => 'checkbox' ));//Show Footer Sections //Blog Posts Settings $wp_customize->add_panel( 'home_guard_blogsettings_panel', array( 'priority' => 3, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Blog Posts Settings', 'home-guard' ), ) ); $wp_customize->add_section('home_guard_blogmeta_options',array( 'title' => __('Blog Meta Options','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting('home_guard_hide_blogdate',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_hide_blogdate', array( 'label' => __('Check to hide post date','home-guard'), 'section' => 'home_guard_blogmeta_options', 'setting' => 'home_guard_hide_blogdate', 'type' => 'checkbox' )); //Blog Date $wp_customize->add_setting('home_guard_hide_postcats',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_hide_postcats', array( 'label' => __('Check to hide post category','home-guard'), 'section' => 'home_guard_blogmeta_options', 'setting' => 'home_guard_hide_postcats', 'type' => 'checkbox' )); //blogposts category $wp_customize->add_section('home_guard_postfeatured_image',array( 'title' => __('Posts Featured image','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting('home_guard_hide_postfeatured_image',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_hide_postfeatured_image', array( 'label' => __('Check to hide post featured image','home-guard'), 'section' => 'home_guard_postfeatured_image', 'setting' => 'home_guard_hide_postfeatured_image', 'type' => 'checkbox' )); //Posts featured image $wp_customize->add_setting('home_guard_blogimg_fullwidth',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_blogimg_fullwidth', array( 'label' => __('Check to featured image Full Width','home-guard'), 'section' => 'home_guard_postfeatured_image', 'setting' => 'home_guard_blogimg_fullwidth', 'type' => 'checkbox' )); //posts featured full $wp_customize->add_section('home_guard_postmorebtn',array( 'title' => __('Posts Read More Button','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting('home_guard_postmorebuttontext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); //blog read more button text $wp_customize->add_control('home_guard_postmorebuttontext',array( 'type' => 'text', 'label' => __('Read more button text for blog posts','home-guard'), 'section' => 'home_guard_postmorebtn', 'setting' => 'home_guard_postmorebuttontext' )); //Post read more button text $wp_customize->add_section('home_guard_postcontent_settings',array( 'title' => __('Posts Excerpt Options','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting( 'home_guard_postexcerptrange', array( 'default' => 30, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'home_guard_sanitize_excerptrange', ) ); $wp_customize->add_control( 'home_guard_postexcerptrange', array( 'label' => __( 'Excerpt length','home-guard' ), 'section' => 'home_guard_postcontent_settings', 'type' => 'range', 'settings' => 'home_guard_postexcerptrange','input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('home_guard_postsfullcontent_options',array( 'default' => 'Excerpt', 'sanitize_callback' => 'home_guard_sanitize_choices' )); $wp_customize->add_control('home_guard_postsfullcontent_options',array( 'type' => 'select', 'label' => __('Posts Content','home-guard'), 'section' => 'home_guard_postcontent_settings', 'choices' => array( 'Content' => __('Content','home-guard'), 'Excerpt' => __('Excerpt','home-guard'), 'No Content' => __('No Excerpt','home-guard') ), ) ); $wp_customize->add_section('home_guard_postsinglemeta',array( 'title' => __('Posts Single Settings','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting('home_guard_hide_postdate_fromsingle',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_hide_postdate_fromsingle', array( 'label' => __('Check to hide post date from single','home-guard'), 'section' => 'home_guard_postsinglemeta', 'setting' => 'home_guard_hide_postdate_fromsingle', 'type' => 'checkbox' )); //Hide Posts date from single $wp_customize->add_setting('home_guard_hide_postcats_fromsingle',array( 'sanitize_callback' => 'home_guard_sanitize_checkbox', )); $wp_customize->add_control( 'home_guard_hide_postcats_fromsingle', array( 'label' => __('Check to hide post category from single','home-guard'), 'section' => 'home_guard_postsinglemeta', 'setting' => 'home_guard_hide_postcats_fromsingle', 'type' => 'checkbox' )); //Hide blogposts category single //Sidebar Settings $wp_customize->add_section('home_guard_sidebarsettings', array( 'title' => __('Sidebar Settings','home-guard'), 'priority' => null, 'panel' => 'home_guard_blogsettings_panel', )); $wp_customize->add_setting('home_guard_hidesidebar_blogposts',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_hidesidebar_blogposts', array( 'settings' => 'home_guard_hidesidebar_blogposts', 'section' => 'home_guard_sidebarsettings', 'label' => __('Check to hide sidebar from homepage','home-guard'), 'type' => 'checkbox' ));//hide sidebar blog posts $wp_customize->add_setting('home_guard_hidesidebar_singleposts',array( 'default' => false, 'sanitize_callback' => 'home_guard_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'home_guard_hidesidebar_singleposts', array( 'settings' => 'home_guard_hidesidebar_singleposts', 'section' => 'home_guard_sidebarsettings', 'label' => __('Check to hide sidebar from single post','home-guard'), 'type' => 'checkbox' ));// Hide sidebar single post } add_action( 'customize_register', 'home_guard_customize_register' ); function home_guard_custom_css(){ ?>