add_section( 'single_options', array( 'title' => __('Single Options', 'avenews'), 'panel' => 'avenews_option_panel', ) ); /* Global Layout*/ $wp_customize->add_setting( 'avenews_options[single_sidebar_layout]', array( 'default' => $default_options['single_sidebar_layout'], 'sanitize_callback' => 'avenews_sanitize_radio', ) ); $wp_customize->add_control( new Avenews_Radio_Image_Control( $wp_customize, 'avenews_options[single_sidebar_layout]', array( 'label' => __('Single Sidebar Layout', 'avenews'), 'section' => 'single_options', 'choices' => avenews_get_general_layouts() ) ) ); $wp_customize->add_setting( 'avenews_options[avenews_single_post_layout]', array( 'default' => $default_options['avenews_single_post_layout'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[avenews_single_post_layout]', array( 'label' => __('Header Appearance Layout', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'layout-1' => esc_html__('Header Classic Layout', 'avenews'), 'layout-2' => esc_html__('Header Banner Layout', 'avenews'), 'layout-3' => esc_html__('Header Banner Layout 2', 'avenews'), ), ) ); $wp_customize->add_setting( 'avenews_options[avenews_single_post_header_overlay]', array( 'default' => $default_options['avenews_single_post_header_overlay'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[avenews_single_post_header_overlay]', array( 'label' => __('Single Post Header Overlay', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'featured-banner-overlay-disable' => esc_html__('Disable Header Overlay', 'avenews'), 'featured-banner-overlay' => esc_html__('Enable Header Overlay', 'avenews'), ), 'active_callback' => 'avenews_single_post_layout_callback', ) ); $wp_customize->add_setting( 'avenews_section_seperator_single_1', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); // Hide Side Bar on Mobile $wp_customize->add_setting( 'avenews_options[hide_single_sidebar_mobile]', array( 'default' => $default_options['hide_single_sidebar_mobile'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[hide_single_sidebar_mobile]', array( 'label' => __('Hide Single Sidebar on Mobile', 'avenews'), 'section' => 'single_options', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'avenews_options[avenews_single_post_style]', array( 'default' => $default_options['avenews_single_post_style'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[avenews_single_post_style]', array( 'label' => __('Single Post Style', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'style-1' => esc_html__('Layout Style 1', 'avenews'), 'style-2' => esc_html__('Layout Style 2', 'avenews'), ), ) ); $wp_customize->add_setting( 'avenews_section_seperator_single_11', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_single_11', array( 'settings' => 'avenews_section_seperator_single_11', 'section' => 'single_options', ) ) ); /* Post Meta */ $wp_customize->add_setting( 'avenews_options[single_post_meta]', array( 'default' => $default_options['single_post_meta'], 'sanitize_callback' => 'avenews_sanitize_checkbox_multiple', ) ); $wp_customize->add_control( new Avenews_Checkbox_Multiple( $wp_customize, 'avenews_options[single_post_meta]', array( 'label' => __('Single Post Meta', 'avenews'), 'description' => __('Choose the post meta you want to be displayed on post detail page', 'avenews'), 'section' => 'single_options', 'choices' => array( 'author' => __('Author', 'avenews'), 'date' => __('Date', 'avenews'), ) ) ) ); $wp_customize->add_setting( 'avenews_section_seperator_single_5', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_single_5', array( 'settings' => 'avenews_section_seperator_single_5', 'section' => 'single_options', ) ) ); $wp_customize->add_setting( 'avenews_options[show_sticky_article_navigation]', array( 'default' => $default_options['show_sticky_article_navigation'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[show_sticky_article_navigation]', array( 'label' => __('Show Sticky Article Navigation', 'avenews'), 'section' => 'single_options', 'type' => 'checkbox', ) ); /*Show Author Info Box start *-------------------------------*/ $wp_customize->add_setting( 'avenews_section_seperator_single_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_single_2', array( 'settings' => 'avenews_section_seperator_single_2', 'section' => 'single_options', ) ) ); $wp_customize->add_setting( 'avenews_options[show_author_info]', array( 'default' => $default_options['show_author_info'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[show_author_info]', array( 'label' => __('Show Author Info Box', 'avenews'), 'section' => 'single_options', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'avenews_section_seperator_single_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_single_3', array( 'settings' => 'avenews_section_seperator_single_3', 'section' => 'single_options', ) ) ); /*Show Related Posts *-------------------------------*/ $wp_customize->add_setting( 'avenews_options[show_related_posts]', array( 'default' => $default_options['show_related_posts'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[show_related_posts]', array( 'label' => __('Show Related Posts', 'avenews'), 'section' => 'single_options', 'type' => 'checkbox', ) ); /*Related Posts Text.*/ $wp_customize->add_setting( 'avenews_options[related_posts_text]', array( 'default' => $default_options['related_posts_text'], 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'avenews_options[related_posts_text]', array( 'label' => __('Related Posts Text', 'avenews'), 'section' => 'single_options', 'type' => 'text', 'active_callback' => 'avenews_is_related_posts_enabled', ) ); /* Number of Related Posts */ $wp_customize->add_setting( 'avenews_options[no_of_related_posts]', array( 'default' => $default_options['no_of_related_posts'], 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'avenews_options[no_of_related_posts]', array( 'label' => __('Number of Related Posts', 'avenews'), 'section' => 'single_options', 'type' => 'number', 'active_callback' => 'avenews_is_related_posts_enabled', ) ); /*Related Posts Orderby*/ $wp_customize->add_setting( 'avenews_options[related_posts_orderby]', array( 'default' => $default_options['related_posts_orderby'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[related_posts_orderby]', array( 'label' => __('Orderby', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'date' => __('Date', 'avenews'), 'id' => __('ID', 'avenews'), 'title' => __('Title', 'avenews'), 'rand' => __('Random', 'avenews'), ), 'active_callback' => 'avenews_is_related_posts_enabled', ) ); /*Related Posts Order*/ $wp_customize->add_setting( 'avenews_options[related_posts_order]', array( 'default' => $default_options['related_posts_order'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[related_posts_order]', array( 'label' => __('Order', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'asc' => __('ASC', 'avenews'), 'desc' => __('DESC', 'avenews'), ), 'active_callback' => 'avenews_is_related_posts_enabled', ) ); $wp_customize->add_setting( 'avenews_section_seperator_single_4', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Avenews_Seperator_Control( $wp_customize, 'avenews_section_seperator_single_4', array( 'settings' => 'avenews_section_seperator_single_4', 'section' => 'single_options', ) ) ); /*Show Author Posts *-----------------------------------------*/ $wp_customize->add_setting( 'avenews_options[show_author_posts]', array( 'default' => $default_options['show_author_posts'], 'sanitize_callback' => 'avenews_sanitize_checkbox', ) ); $wp_customize->add_control( 'avenews_options[show_author_posts]', array( 'label' => __('Show Author Posts', 'avenews'), 'section' => 'single_options', 'type' => 'checkbox', ) ); /*Author Posts Text.*/ $wp_customize->add_setting( 'avenews_options[author_posts_text]', array( 'default' => $default_options['author_posts_text'], 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'avenews_options[author_posts_text]', array( 'label' => __('Author Posts Text', 'avenews'), 'section' => 'single_options', 'type' => 'text', 'active_callback' => 'avenews_is_author_posts_enabled', ) ); /* Number of Author Posts */ $wp_customize->add_setting( 'avenews_options[no_of_author_posts]', array( 'default' => $default_options['no_of_author_posts'], 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'avenews_options[no_of_author_posts]', array( 'label' => __('Number of Author Posts', 'avenews'), 'section' => 'single_options', 'type' => 'number', 'active_callback' => 'avenews_is_author_posts_enabled', ) ); /*Author Posts Orderby*/ $wp_customize->add_setting( 'avenews_options[author_posts_orderby]', array( 'default' => $default_options['author_posts_orderby'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[author_posts_orderby]', array( 'label' => __('Orderby', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'date' => __('Date', 'avenews'), 'id' => __('ID', 'avenews'), 'title' => __('Title', 'avenews'), 'rand' => __('Random', 'avenews'), ), 'active_callback' => 'avenews_is_author_posts_enabled', ) ); /*Author Posts Order*/ $wp_customize->add_setting( 'avenews_options[author_posts_order]', array( 'default' => $default_options['author_posts_order'], 'sanitize_callback' => 'avenews_sanitize_select', ) ); $wp_customize->add_control( 'avenews_options[author_posts_order]', array( 'label' => __('Order', 'avenews'), 'section' => 'single_options', 'type' => 'select', 'choices' => array( 'asc' => __('ASC', 'avenews'), 'desc' => __('DESC', 'avenews'), ), 'active_callback' => 'avenews_is_author_posts_enabled', ) );