add_panel( 'boutique_designer_shop_custompage_panel', array( 'title' => esc_html__( 'Custom Page Settings', 'boutique-designer-shop' ), 'priority' => 2, )); // Top bar $wp_customize->add_section('boutique_designer_shop_top',array( 'title' => __('Header', 'boutique-designer-shop'), 'panel' => 'boutique_designer_shop_custompage_panel', ) ); $wp_customize->add_setting( 'boutique_designer_shop_section_contact_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Section_Heading( $wp_customize, 'boutique_designer_shop_section_contact_heading', array( 'label' => esc_html__( 'Header Settings', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_top', 'settings' => 'boutique_designer_shop_section_contact_heading', ) ) ); $wp_customize->add_setting('boutique_designer_shop_topbar_text',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('boutique_designer_shop_topbar_text',array( 'label' => esc_html__('Add Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_top', 'setting' => 'boutique_designer_shop_topbar_text', 'type' => 'text' )); $wp_customize->add_setting('boutique_designer_shop_email',array( 'default' => '', 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('boutique_designer_shop_email',array( 'label' => esc_html__('Add Email Address','boutique-designer-shop'), 'section' => 'boutique_designer_shop_top', 'setting' => 'boutique_designer_shop_email', 'type' => 'text', )); $wp_customize->add_setting('boutique_designer_shop_call',array( 'default' => '', 'sanitize_callback' => 'boutique_designer_shop_sanitize_phone_number' )); $wp_customize->add_control('boutique_designer_shop_call',array( 'label' => esc_html__('Add Phone No','boutique-designer-shop'), 'section' => 'boutique_designer_shop_top', 'setting' => 'boutique_designer_shop_call', 'type' => 'text', )); if ( class_exists( 'WooCommerce' ) ) { $wp_customize->add_setting( 'boutique_designer_shop_cart_enable', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_callback_sanitize_switch', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Switch( $wp_customize, 'boutique_designer_shop_cart_enable', array( 'settings' => 'boutique_designer_shop_cart_enable', 'section' => 'boutique_designer_shop_top', 'label' => __( 'Check to show Header Cart', 'boutique-designer-shop' ), 'choices' => array( '1' => __( 'On', 'boutique-designer-shop' ), 'off' => __( 'Off', 'boutique-designer-shop' ), ), 'active_callback' => '', ) ) ); } //slider $wp_customize->add_section( 'boutique_designer_shop_slider_section' , array( 'title' => __( 'Slider Settings', 'boutique-designer-shop' ), 'panel' => 'boutique_designer_shop_custompage_panel', ) ); $wp_customize->add_setting( 'boutique_designer_shop_section_slide_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Section_Heading( $wp_customize, 'boutique_designer_shop_section_slide_heading', array( 'label' => esc_html__( 'Slider Settings', 'boutique-designer-shop' ), 'description' => __( 'Slider Image Dimension ( 1600px x 650px )', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_slider_section', 'settings' => 'boutique_designer_shop_section_slide_heading', ) ) ); $wp_customize->add_setting( 'boutique_designer_shop_slider_arrows', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_callback_sanitize_switch', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Switch( $wp_customize, 'boutique_designer_shop_slider_arrows', array( 'settings' => 'boutique_designer_shop_slider_arrows', 'section' => 'boutique_designer_shop_slider_section', 'label' => __( 'Check To Show Slider', 'boutique-designer-shop' ), 'choices' => array( '1' => __( 'On', 'boutique-designer-shop' ), 'off' => __( 'Off', 'boutique-designer-shop' ), ), 'active_callback' => '', ) ) ); $wp_customize->add_setting('boutique_designer_shop_slide_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('boutique_designer_shop_slide_heading',array( 'label' => esc_html__('Slider Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_slider_section', 'setting' => 'boutique_designer_shop_slide_heading', 'type' => 'text', 'active_callback' => 'boutique_designer_shop_slider_dropdown', )); $args = array('numberposts' => -1); $post_list = get_posts($args); $i = 0; $pst_sls[]= __('Select','boutique-designer-shop'); foreach ($post_list as $key => $p_post) { $pst_sls[$p_post->ID]=$p_post->post_title; } for ( $i = 1; $i <= 4; $i++ ) { $wp_customize->add_setting('boutique_designer_shop_post_setting'.$i,array( 'sanitize_callback' => 'boutique_designer_shop_sanitize_select', )); $wp_customize->add_control('boutique_designer_shop_post_setting'.$i,array( 'type' => 'select', 'choices' => $pst_sls, 'label' => __('Select post','boutique-designer-shop'), 'section' => 'boutique_designer_shop_slider_section', 'active_callback' => 'boutique_designer_shop_slider_dropdown', )); } wp_reset_postdata(); $wp_customize->add_setting( 'boutique_designer_shop_slider_excerpt_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_callback_sanitize_switch', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Switch( $wp_customize, 'boutique_designer_shop_slider_excerpt_show_hide', array( 'settings' => 'boutique_designer_shop_slider_excerpt_show_hide', 'section' => 'boutique_designer_shop_slider_section', 'label' => __( 'Show Hide excerpt', 'boutique-designer-shop' ), 'choices' => array( '1' => __( 'On', 'boutique-designer-shop' ), 'off' => __( 'Off', 'boutique-designer-shop' ), ), 'active_callback' => 'boutique_designer_shop_slider_dropdown', ) ) ); $wp_customize->add_setting('boutique_designer_shop_slider_excerpt_count',array( 'default'=> 30, 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_sanitize_integer' )); $wp_customize->add_control(new Boutique_Designer_Shop_Slider_Custom_Control( $wp_customize, 'boutique_designer_shop_slider_excerpt_count',array( 'label' => esc_html__( 'Excerpt Limit','boutique-designer-shop' ), 'section'=> 'boutique_designer_shop_slider_section', 'settings'=>'boutique_designer_shop_slider_excerpt_count', 'input_attrs' => array( 'reset' => 30, 'step' => 1, 'min' => 0, 'max' => 50, ), 'active_callback' => 'boutique_designer_shop_slider_dropdown', ))); $wp_customize->add_setting( 'boutique_designer_shop_slider_button_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_callback_sanitize_switch', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Switch( $wp_customize, 'boutique_designer_shop_slider_button_show_hide', array( 'settings' => 'boutique_designer_shop_slider_button_show_hide', 'section' => 'boutique_designer_shop_slider_section', 'label' => __( 'Show Hide Button', 'boutique-designer-shop' ), 'choices' => array( '1' => __( 'On', 'boutique-designer-shop' ), 'off' => __( 'Off', 'boutique-designer-shop' ), ), 'active_callback' => 'boutique_designer_shop_slider_dropdown', ) ) ); $wp_customize->add_setting('boutique_designer_shop_slider_read_more',array( 'default' => 'READ MORE', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('boutique_designer_shop_slider_read_more',array( 'label' => esc_html__('Button Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_slider_section', 'setting' => 'boutique_designer_shop_slider_read_more', 'type' => 'text', 'active_callback' => 'boutique_designer_shop_slider_dropdown', )); $wp_customize->add_setting( 'boutique_designer_shop_slider_content_alignment', array( 'default' => 'LEFT-ALIGN', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_sanitize_choices' ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Text_Radio_Button_Custom_Control( $wp_customize, 'boutique_designer_shop_slider_content_alignment', array( 'type' => 'select', 'label' => esc_html__( 'Slider Content Alignment', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_slider_section', 'choices' => array( 'LEFT-ALIGN' => __('LEFT','boutique-designer-shop'), 'CENTER-ALIGN' => __('CENTER','boutique-designer-shop'), 'RIGHT-ALIGN' => __('RIGHT','boutique-designer-shop'), ), 'active_callback' => 'boutique_designer_shop_slider_dropdown', ) ) ); // Product $wp_customize->add_section('boutique_designer_shop_millions_of_hours_section',array( 'title' => __('Product Settings','boutique-designer-shop'), 'panel' => 'boutique_designer_shop_custompage_panel', )); $wp_customize->add_setting( 'boutique_designer_shop_section_product_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Section_Heading( $wp_customize, 'boutique_designer_shop_section_product_heading', array( 'label' => esc_html__( 'Product Settings', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_millions_of_hours_section', 'settings' => 'boutique_designer_shop_section_product_heading', ) ) ); $wp_customize->add_setting( 'boutique_designer_shop_product_enable', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_callback_sanitize_switch', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Switch( $wp_customize, 'boutique_designer_shop_product_enable', array( 'settings' => 'boutique_designer_shop_product_enable', 'section' => 'boutique_designer_shop_millions_of_hours_section', 'label' => __( 'Check To Show Product Settings', 'boutique-designer-shop' ), 'choices' => array( '1' => __( 'On', 'boutique-designer-shop' ), 'off' => __( 'Off', 'boutique-designer-shop' ), ), 'active_callback' => '', ) ) ); $wp_customize->selective_refresh->add_partial( 'boutique_designer_shop_product_section_heading', array( 'selector' => '#product-section h3', 'render_callback' => 'boutique_designer_shop_customize_partial_boutique_designer_shop_product_section_heading', ) ); $wp_customize->add_setting('boutique_designer_shop_product_section_sub_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('boutique_designer_shop_product_section_sub_heading',array( 'type' => 'text', 'label' => __('Sub Heading Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_millions_of_hours_section', 'active_callback' => 'boutique_designer_shop_product_dropdown' )); $wp_customize->add_setting('boutique_designer_shop_product_section_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('boutique_designer_shop_product_section_heading',array( 'type' => 'text', 'label' => __('Heading Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_millions_of_hours_section', 'active_callback' => 'boutique_designer_shop_product_dropdown' )); // Product settings $boutique_designer_shop_args = array( 'type' => 'product', 'child_of' => 0, 'parent' => '', 'orderby' => 'term_group', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => 1, 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false ); $categories = get_categories($boutique_designer_shop_args); $cat_posts = array(); $m = 0; $cat_posts[]='Select'; foreach($categories as $category){ if($m==0){ $default = $category->slug; $m++; } $cat_posts[$category->slug] = $category->name; } $wp_customize->add_setting('boutique_designer_shop_product_category',array( 'default' => 'select', 'sanitize_callback' => 'boutique_designer_shop_sanitize_select', )); $wp_customize->add_control('boutique_designer_shop_product_category',array( 'type' => 'select', 'choices' => $cat_posts, 'label' => __('Select category to display products ','boutique-designer-shop'), 'section' => 'boutique_designer_shop_millions_of_hours_section', 'active_callback' => 'boutique_designer_shop_product_dropdown' )); $wp_customize->add_setting('boutique_designer_shop_product_category_number',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('boutique_designer_shop_product_category_number',array( 'label' => __('Number of posts to show in a category','boutique-designer-shop'), 'section' => 'boutique_designer_shop_millions_of_hours_section', 'type' => 'number', 'active_callback' => 'boutique_designer_shop_product_dropdown', )); //Footer $wp_customize->add_section( 'boutique_designer_shop_footer_copyright', array( 'title' => esc_html__( 'Footer Text', 'boutique-designer-shop' ), 'panel' => 'boutique_designer_shop_custompage_panel', ) ); $wp_customize->add_setting( 'boutique_designer_shop_section_footer_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Customizer_Customcontrol_Section_Heading( $wp_customize, 'boutique_designer_shop_section_footer_heading', array( 'label' => esc_html__( 'Footer Setting', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_footer_copyright', 'settings' => 'boutique_designer_shop_section_footer_heading', ) ) ); $wp_customize->add_setting('boutique_designer_shop_footer_text',array( 'default' => 'Boutique Designer Shop WordPress Theme', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('boutique_designer_shop_footer_text',array( 'label' => esc_html__('Copyright Text','boutique-designer-shop'), 'section' => 'boutique_designer_shop_footer_copyright', 'type' => 'textarea' )); $wp_customize->add_setting( 'boutique_designer_shop_footer_content_alignment', array( 'default' => 'CENTER-ALIGN', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_sanitize_choices' ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Text_Radio_Button_Custom_Control( $wp_customize, 'boutique_designer_shop_footer_content_alignment', array( 'type' => 'select', 'label' => esc_html__( 'Footer Content Alignment', 'boutique-designer-shop' ), 'section' => 'boutique_designer_shop_footer_copyright', 'choices' => array( 'LEFT-ALIGN' => __('LEFT','boutique-designer-shop'), 'CENTER-ALIGN' => __('CENTER','boutique-designer-shop'), 'RIGHT-ALIGN' => __('RIGHT','boutique-designer-shop'), ), 'active_callback' => '', ) ) ); $wp_customize->selective_refresh->add_partial( 'boutique_designer_shop_footer_text', array( 'selector' => '.site-info', 'render_callback' => 'boutique_designer_shop_customize_partial_boutique_designer_shop_footer_text', ) ); $wp_customize->add_setting( 'boutique_designer_shop_footer_widget', array( 'default' => '4', 'transport' => 'refresh', 'sanitize_callback' => 'boutique_designer_shop_sanitize_choices' ) ); $wp_customize->add_control( new Boutique_Designer_Shop_Text_Radio_Button_Custom_Control( $wp_customize, 'boutique_designer_shop_footer_widget', array( 'type' => 'select', 'label' => esc_html__('Footer Per Column','boutique-designer-shop'), 'section' => 'boutique_designer_shop_footer_copyright', 'choices' => array( '1' => __('1','boutique-designer-shop'), '2' => __('2','boutique-designer-shop'), '3' => __('3','boutique-designer-shop'), '4' => __('4','boutique-designer-shop'), ) ) ) );