add_section( 'archive_options', array( 'title' => __('Archive Options', 'avenews'), 'panel' => 'avenews_option_panel', ) ); /* Global Layout*/ $wp_customize->add_setting( 'avenews_options[global_sidebar_layout]', array( 'default' => $default_options['global_sidebar_layout'], 'sanitize_callback' => 'avenews_sanitize_radio', ) ); $wp_customize->add_control( new Avenews_Radio_Image_Control( $wp_customize, 'avenews_options[global_sidebar_layout]', array( 'label' => __('Global Sidebar Layout', 'avenews'), 'section' => 'archive_options', 'choices' => avenews_get_general_layouts() ) ) ); // Hide Side Bar on Mobile $wp_customize->add_setting( 'avenews_options[hide_global_sidebar_mobile]', array( 'default' => $default_options['hide_global_sidebar_mobile'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[hide_global_sidebar_mobile]', array( 'label' => __('Hide Global Sidebar on Mobile', 'avenews'), 'section' => 'archive_options', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'avenews_section_seperator_archive_1', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_archive_1', array( 'settings' => 'avenews_section_seperator_archive_1', 'section' => 'archive_options', ) ) ); /* Archive Style */ $wp_customize->add_setting( 'avenews_options[archive_style]', array( 'default' => $default_options['archive_style'], 'sanitize_callback' => 'avenews_sanitize_radio', ) ); $wp_customize->add_control( new Avenews_Radio_Image_Control( $wp_customize, 'avenews_options[archive_style]', array( 'label' => __('Archive Style', 'avenews'), 'section' => 'archive_options', 'choices' => avenews_get_archive_layouts() ) ) ); $wp_customize->add_setting( 'avenews_section_seperator_archive_2', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_archive_2', array( 'settings' => 'avenews_section_seperator_archive_2', 'section' => 'archive_options', ) ) ); /* Archive Meta */ $wp_customize->add_setting( 'avenews_options[archive_post_meta_1]', array( 'default' => $default_options['archive_post_meta_1'], 'sanitize_callback' => 'avenews_sanitize_checkbox_multiple', ) ); $wp_customize->add_control( new Avenews_Checkbox_Multiple( $wp_customize, 'avenews_options[archive_post_meta_1]', array( 'label' => __('Archive Post Meta', 'avenews'), 'description' => __('Please select which post meta data you would like to appear on the listings for archived posts.', 'avenews'), 'section' => 'archive_options', 'choices' => array( 'author' => __('Author', 'avenews'), 'date' => __('Date', 'avenews'), 'comment' => __('Comment', 'avenews'), 'category' => __('Category', 'avenews'), 'tags' => __('Tags', 'avenews'), ), 'active_callback' => 'avenews_archive_poost_meta_1', ) ) ); /* Archive Meta */ $wp_customize->add_setting( 'avenews_options[archive_post_meta_2]', array( 'default' => $default_options['archive_post_meta_2'], 'sanitize_callback' => 'avenews_sanitize_checkbox_multiple', ) ); $wp_customize->add_control( new Avenews_Checkbox_Multiple( $wp_customize, 'avenews_options[archive_post_meta_2]', array( 'label' => __('Archive Post Meta', 'avenews'), 'description' => __('Please select which post meta data you would like to appear on the listings for archived posts.', 'avenews'), 'section' => 'archive_options', 'choices' => array( 'author' => __('Author', 'avenews'), 'date' => __('Date', 'avenews'), 'category' => __('Category', 'avenews'), ), 'active_callback' => 'avenews_archive_poost_meta_2', ) ) ); /* Archive Meta */ $wp_customize->add_setting( 'avenews_options[archive_post_meta_3]', array( 'default' => $default_options['archive_post_meta_3'], 'sanitize_callback' => 'avenews_sanitize_checkbox_multiple', ) ); $wp_customize->add_control( new Avenews_Checkbox_Multiple( $wp_customize, 'avenews_options[archive_post_meta_3]', array( 'label' => __('Archive Post Meta', 'avenews'), 'description' => __('Please select which post meta data you would like to appear on the listings for archived posts.', 'avenews'), 'section' => 'archive_options', 'choices' => array( 'author' => __('Author', 'avenews'), 'date' => __('Date', 'avenews'), 'category' => __('Category', 'avenews'), ), 'active_callback' => 'avenews_archive_poost_meta_3', ) ) ); /* Archive Meta */ $wp_customize->add_setting( 'avenews_options[archive_post_meta_4]', array( 'default' => $default_options['archive_post_meta_4'], 'sanitize_callback' => 'avenews_sanitize_checkbox_multiple', ) ); $wp_customize->add_control( new Avenews_Checkbox_Multiple( $wp_customize, 'avenews_options[archive_post_meta_4]', array( 'label' => __('Archive Post Meta', 'avenews'), 'description' => __('Please select which post meta data you would like to appear on the listings for archived posts.', 'avenews'), 'section' => 'archive_options', 'choices' => array( 'category' => __('Category', 'avenews'), ), 'active_callback' => 'avenews_archive_poost_meta_4', ) ) ); $wp_customize->add_setting( 'avenews_section_seperator_archive_3', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_archive_3', array( 'settings' => 'avenews_section_seperator_archive_3', 'section' => 'archive_options', ) ) ); $wp_customize->add_setting('avenews_options[excerpt_length]', array( 'default' => $default_options['excerpt_length'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'avenews_sanitize_number_range', ) ); $wp_customize->add_control('avenews_options[excerpt_length]', array( 'label' => esc_html__('Excerpt Length', 'avenews'), 'description' => esc_html__('Max number of words. Set it to 0 to disable. (step-1)', 'avenews'), 'section' => 'archive_options', 'type' => 'range', 'input_attrs' => array( 'min' => 0, 'max' => 100, 'step' => 1, ), ) ); $wp_customize->add_setting( 'avenews_options[enable_excerpt_read_more]', array( 'default' => $default_options['enable_excerpt_read_more'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[enable_excerpt_read_more]', array( 'label' => __('Enable Read More on Excerpt', 'avenews'), 'section' => 'archive_options', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'avenews_options[excerpt_read_more]', array( 'default' => $default_options['excerpt_read_more'], 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'avenews_options[excerpt_read_more]', array( 'label' => __('Excerpt Readmore Button Text', 'avenews'), 'section' => 'archive_options', 'type' => 'text', ) );