add_setting( 'bc_blog_title' , array( 'default' => 'The Blog', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_blog_title', array( 'label' => __( 'Blog Posts Title', 'broadcast-lite' ), 'description' => __( 'Change the title of the blog posts section. Leave blank for no title.', 'broadcast-lite' ), 'type' => 'text', 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_title', ) ); // SETTING - bc_blog_check $wp_customize->add_setting( 'bc_blog_check' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_checkbox', ) ); $wp_customize->add_control( 'bc_blog_check', array( 'label' => __( 'Hide Blog Posts?', 'broadcast-lite' ), 'description' => __( 'Check this box to hide the Blog Posts section.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_check', 'type' => 'checkbox', ) ); // END SETTING // SETTING - Post Limit $wp_customize->add_setting( 'bc_post_limit', array( 'default' => get_option( 'posts_per_page', 10 ), // Default to the reading setting. 'transport' => 'refresh', 'sanitize_callback' => 'absint', // Ensure the value is a positive integer. ) ); // CONTROL - Post Limit Range $wp_customize->add_control( 'bc_post_limit', array( 'label' => __( 'Post Limit', 'broadcast-lite' ), 'description' => __( 'Set the maximum number of posts to display on the front page.', 'broadcast-lite' ), 'type' => 'range', // Range input type. 'section' => 'bc_blog_settings', // Adjust to your section ID. 'settings' => 'bc_post_limit', 'input_attrs' => array( 'min' => 1, // Minimum value for the range. 'max' => 10, // Maximum value for the range. 'step' => 1, // Increment steps. ), ) ); // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_section_bg_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_section_bg_color', array( 'label' => __( 'Section Background Color', 'broadcast-lite' ), 'description' => __( 'Choose a background color for this section.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_section_bg_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_section_title_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_section_title_color', array( 'label' => __( 'Section Title Color', 'broadcast-lite' ), 'description' => __( 'Choose a title color for this section.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_section_title_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_post_title_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_post_title_color', array( 'label' => __( 'Blog Post Title Color', 'broadcast-lite' ), 'description' => __( 'Choose a color for blog post titles.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_post_title_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_post_subtitle_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_post_subtitle_color', array( 'label' => __( 'Blog Post Subtitle Color', 'broadcast-lite' ), 'description' => __( 'Choose a color for blog post subtitles.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_post_subtitle_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_bg_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, 'bc_blog_bg_color', array( 'label' => __( 'Blog Post Background Color', 'broadcast-lite' ), 'description' => __( 'Choose a color for blog post backgrounds.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_bg_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_text_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_text_color', array( 'label' => __( 'Blog Post Text Color', 'broadcast-lite' ), 'description' => __( 'Choose a color for blog post text.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_text_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_border_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_border_color', array( 'label' => __( 'Blog Post Border Color', 'broadcast-lite' ), 'description' => __( 'Choose a color for blog post borders.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_border_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_border_radius' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_checkbox' ) ); $wp_customize->add_control( 'bc_blog_border_radius', array( 'label' => __( 'Add a border radius', 'broadcast-lite' ), 'description' => __( 'Check this box to add rounded corners to your blog posts.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_border_radius', 'type' => 'checkbox', ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_button_bg_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_button_bg_color', array( 'label' => __( 'Button Background', 'broadcast-lite' ), 'description' => __( 'Choose a background color for your Read More buttons.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_button_bg_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_button_border_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_button_border_color', array( 'label' => __( 'Button Border', 'broadcast-lite' ), 'description' => __( 'Choose a border color for your Read More buttons..', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_button_border_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_button_text_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_blog_button_text_color', array( 'label' => __( 'Button Text', 'broadcast-lite' ), 'description' => __( 'Choose a text color for your Read More buttons..', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_button_text_color', ) ) ); // END SETTING // SETTING - bc_logo_size $wp_customize->add_setting( 'bc_blog_button_border_radius' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_blog_button_border_radius', array( 'label' => __( 'Button Border Radius', 'broadcast-lite' ), 'description' => __( 'Adjust the rounded corners of the button. 0 for none, default is 5.', 'broadcast-lite'), 'type' => 'number', 'input_attrs' => array( 'min' => 0, 'max' => 30, 'step' => 5 ), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_button_border_radius', ) ); // END SETTING // SETTING - bc_primary_font $wp_customize->add_setting( 'bc_blog_button_style' , array( 'transport' => 'refresh', 'sanitize_callback' => 'jt_sanitize_favorite_fruit', ) ); $wp_customize->add_control( new JT_Customize_Control_Checkbox_Multiple( $wp_customize, 'bc_blog_button_style', array( 'section' => 'bc_blog_settings', 'label' => 'Button Styles', 'description' => __( 'Choose the primary button styles.', 'broadcast-lite'), 'choices' => array( 'bold' => 'Bold', 'italic' => 'Italic', 'underline' => 'Underline', 'uppercase' => 'Uppercase', 'capitalize' => 'Capitalize', 'lowercase' => 'Lowercase' ) ) ) ); // END SETTING // SETTING - bc_blog_bg_image $wp_customize->add_setting( 'bc_blog_bg_image' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_blog_bg_image', array( 'label' => __( '(Advanced) Background Image', 'broadcast-lite' ), 'description' => __( 'This image should be large, as it\'s set to cover the entire section.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_bg_image', ) ) ); // END SETTING // SETTING - bc_blog_bg_size $wp_customize->add_setting( 'bc_blog_bg_size', array( 'default' => 'cover', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); // CONTROL - Dropdown for Background Image Size $wp_customize->add_control( 'bc_blog_bg_size', array( 'type' => 'select', 'label' => __( 'Background Image Size', 'broadcast-lite' ), 'description' => __( 'Choose how the background image should be displayed.', 'broadcast-lite' ), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_bg_size', 'choices' => array( 'cover' => __( 'Cover', 'broadcast-lite' ), 'contain' => __( 'Contain', 'broadcast-lite' ), ), ) ); // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_blog_section_gradient' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_textarea_field' ) ); $wp_customize->add_control( 'bc_blog_section_gradient', array( 'label' => __( '(Advanced) Gradient Background', 'broadcast-lite' ), 'description' => __( 'If you\'d like to use a gradient background instead of solid color, add your gradient CSS here. You can generate CSS here.', 'broadcast-lite'), 'section' => 'bc_blog_settings', 'settings' => 'bc_blog_section_gradient', 'type' => 'textarea', ) ); // END SETTING } add_action( 'customize_register', 'broadcast_customize_blog_settings' );