add_panel( 'theme_options', array( 'priority' => 23, 'capability' => 'edit_theme_options', 'title' => __('Theme Options', 'aqwa'), ) ); } // add section public function customizer_sections( $wp_customize ) { $this->selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; // Excerpt section $wp_customize->add_section( 'excerpt_settings', array( 'title' => esc_html__( 'Excerpt Settings', 'aqwa' ), 'panel' => 'theme_options', 'priority' => 3, ) ); // Breadcrumb Section $wp_customize->add_section( 'breadcrumb_section', array( 'title' => esc_html__( 'Breadcrumb Settings', 'aqwa' ), 'panel' => 'theme_options', 'priority' => 3, ) ); } public function customize_post_full_or_excerpt( $wp_customize ){ // Excerpt $wp_customize->add_setting( 'aqwa_display_excerpt_or_full_post', array( 'capability' => 'edit_theme_options', 'default' => 'excerpt', 'sanitize_callback' => function( $value ) { return 'excerpt' === $value || 'full' === $value ? $value : 'excerpt'; }, ) ); // Excerpt $wp_customize->add_control( 'aqwa_display_excerpt_or_full_post', array( 'type' => 'radio', 'section' => 'excerpt_settings', 'label' => esc_html__( 'On Archive Pages, posts show:', 'aqwa' ), 'choices' => array( 'excerpt' => esc_html__( 'Summary', 'aqwa' ), 'full' => esc_html__( 'Full text', 'aqwa' ), ), ) ); } public function customize_setting_breadcrumb( $wp_customize ){ // is display Breadcrumb $wp_customize->add_setting( 'aqwa_display_breadcrumb', array( 'default' => true, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'aqwa_sanitize_checkbox', ) ); $wp_customize->add_control( 'aqwa_display_breadcrumb', array( 'label' => __('Show/Hide Breadcrumb','aqwa'), 'section' => 'breadcrumb_section', 'type' => 'checkbox', 'priority' => 1, ) ); // Breadcrumb Background image $wp_customize->add_setting( 'aqwa_breadcrumb_bg_image' , array( 'default' => esc_url(get_template_directory_uri() .'/assets/images/breadcrumb.jpg'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'aqwa_sanitize_url', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'aqwa_breadcrumb_bg_image' , array( 'label' => esc_html__( 'Background Image', 'aqwa'), 'section' => 'breadcrumb_section', 'priority' => 3, ) )); } } new Aqwa_Theme_Option_Customize(); }