add_section( 'section_featured_posts', array( 'title' => __( 'Latest Posts Section', 'boxing-club' ), 'priority' => 100, 'capability' => 'edit_theme_options', 'panel' => 'home_page_panel', ) ); // Enable Section $wp_customize->add_setting('theme_options[enable_featured_posts_section]', array( 'default' => $default['enable_featured_posts_section'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boxing_club_sanitize_checkbox' ) ); $wp_customize->add_control('theme_options[enable_featured_posts_section]', array( 'label' => __('Enable Section', 'boxing-club'), 'section' => 'section_featured_posts', 'settings' => 'theme_options[enable_featured_posts_section]', 'type' => 'checkbox', ) ); // Section Title $wp_customize->add_setting('theme_options[featured_posts_section_title]', array( 'default' => $default['featured_posts_section_title'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[featured_posts_section_title]', array( 'label' => __('Section Title', 'boxing-club'), 'section' => 'section_featured_posts', 'settings' => 'theme_options[featured_posts_section_title]', 'active_callback' => 'boxing_club_featured_posts_active', 'type' => 'text' ) ); // Section Second Title $wp_customize->add_setting('theme_options[featured_posts_section_2_title]', array( 'default' => $default['featured_posts_section_2_title'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[featured_posts_section_2_title]', array( 'label' => __('Section Second Title', 'boxing-club'), 'section' => 'section_featured_posts', 'settings' => 'theme_options[featured_posts_section_2_title]', 'active_callback' => 'boxing_club_featured_posts_active', 'type' => 'text' ) ); // Featured Posts Number. $wp_customize->add_setting( 'theme_options[featured_posts_number]', array( 'default' => $default['featured_posts_number'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boxing_club_sanitize_number_range', ) ); $wp_customize->add_control( 'theme_options[featured_posts_number]', array( 'label' => __('Items (Max: 6)', 'boxing-club'), 'section' => 'section_featured_posts', 'active_callback' => 'boxing_club_featured_posts_active', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 6, 'step' => 1, 'style' => 'width: 115px;' ), ) ); // Column $wp_customize->add_setting('theme_options[featured_posts_column]', array( 'default' => $default['featured_posts_column'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boxing_club_sanitize_select' ) ); $wp_customize->add_control(new boxing_club_Image_Radio_Control($wp_customize, 'theme_options[featured_posts_column]', array( 'label' => __('Select Column', 'boxing-club'), 'section' => 'section_featured_posts', 'settings' => 'theme_options[featured_posts_column]', 'type' => 'radio-image', 'active_callback' => 'boxing_club_featured_posts_active', 'choices' => array( 'col-1' => esc_url(get_template_directory_uri()) . '/assets/images/column-1.jpg', 'col-2' => esc_url(get_template_directory_uri()) . '/assets/images/column-2.jpg', 'col-3' => esc_url(get_template_directory_uri()) . '/assets/images/column-3.jpg', 'col-4' => esc_url(get_template_directory_uri()) . '/assets/images/column-4.jpg', 'col-5' => esc_url(get_template_directory_uri()) . '/assets/images/column-5.jpg', 'col-6' => esc_url(get_template_directory_uri()) . '/assets/images/column-6.jpg', ), )) ); $featured_posts_number = boxing_club_get_option( 'featured_posts_number' ); // Setting Category. $wp_customize->add_setting( 'theme_options[featured_posts_category]', array( 'default' => $default['featured_posts_category'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new boxing_club_Dropdown_Taxonomies_Control( $wp_customize, 'theme_options[featured_posts_category]', array( 'label' => __( 'Select Category', 'boxing-club' ), 'section' => 'section_featured_posts', 'settings' => 'theme_options[featured_posts_category]', 'active_callback' => 'boxing_club_featured_posts_active', ) ) );