remove_control( 'display_header_text' ); /** * Add sections. */ $blogfeedly_sections = stsblogfeedly_theme_settings_sections(); foreach ( $blogfeedly_sections as $section ) { $wp_customize->add_section( $section['name'], array( 'title' => $section['title'], 'priority' => $section['priority'] ) ); } /* New Section */ $wp_customize->add_section( 'postpage', array( 'title' => __('Posts & Pages','blogfeedly'), 'priority' => 1, 'capability' => 'edit_theme_options', ) ); /* New Section */ $wp_customize->add_section( 'sidebar', array( 'title' => __('Sidebar Settings','blogfeedly'), 'priority' => 1, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'hide_sidebar', array( 'default' => 0, 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'hide_sidebar', array( 'label' => __( 'Hide Sidebar', 'blogfeedly' ), 'section' => 'sidebar', 'priority' => 1, 'settings' => 'hide_sidebar', 'type' => 'checkbox', ) ); /* New Section */ $wp_customize->add_section( 'footer', array( 'title' => __('Footer Settings','blogfeedly'), 'priority' => 1, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'footer_bg', array( 'default' => '#171717', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_bg', array( 'label' => __( 'Background Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_bg', ) ) ); $wp_customize->add_setting( 'footer_header', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_header', array( 'label' => __( 'Headline Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_header', ) ) ); $wp_customize->add_setting( 'footer_text', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_text', array( 'label' => __( 'Text Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_text', ) ) ); $wp_customize->add_setting( 'footer_link', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_link', array( 'label' => __( 'Link Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_link', ) ) ); $wp_customize->add_setting( 'footer_border', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_border', array( 'label' => __( 'Border Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_border', ) ) ); $wp_customize->add_setting( 'footer_button_bg', array( 'default' => '#fab526', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_button_bg', array( 'label' => __( 'Button Background Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_button_bg', ) ) ); $wp_customize->add_setting( 'footer_button_text', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_button_text', array( 'label' => __( 'Button Text Color', 'blogfeedly' ), 'section' => 'footer', 'priority' => 1, 'settings' => 'footer_button_text', ) ) ); /** * Add settings and controls. */ $blogfeedly_settings = stsblogfeedly_theme_settings_fields(); foreach ( $blogfeedly_settings as $option ) { $wp_customize->add_setting( 'stsblogfeedly_options[' . $option['name'] . ']', array( 'default' => $option['default'], 'type' => 'option', 'sanitize_callback' => $option['sanitize'] ) ); if ( $option['type'] == 'color' ) { $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'stsblogfeedly_' . $option['name'], array( 'label' => $option['title'], 'section' => $option['section'], 'settings' => 'stsblogfeedly_options[' . $option['name'] . ']', 'priority' => $option['priority'] ) ) ); } else { $wp_customize->add_control( 'stsblogfeedly_' . $option['name'], array( 'label' => $option['title'], 'section' => $option['section'], 'settings' => 'stsblogfeedly_options[' . $option['name'] . ']', 'type' => $option['type'], 'priority' => $option['priority'] ) ); } } } add_action( 'customize_register', 'stsblogfeedly_customize_register' ); /** * Checkbox sanitization callback. */ function stsblogfeedly_sanitize_checkbox( $input ) { return ( ( isset( $input ) && true == $input ) ? true : false ); } /** * HTML sanitization callback. */ function stsblogfeedly_sanitize_html( $input ) { return wp_filter_post_kses( $input ); } /** * No HTML sanitization callback. */ function stsblogfeedly_sanitize_nohtml( $input ) { return wp_filter_nohtml_kses( $input ); } /** * Nonnegative integer sanitization callback. */ function stsblogfeedly_sanitize_number( $input ) { $input = absint( $input ); if ( ! $input ) $input = ''; return $input; } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function blogfeedly_customize_preview_js() { wp_enqueue_script( 'blogfeedly-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'blogfeedly_customize_preview_js' ); if(! function_exists('blogfeedly_customizer_styling' ) ): function blogfeedly_customizer_styling(){ ?>