get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'Butcher_Meatshop_Customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'Butcher_Meatshop_Customize_partial_blogdescription', ) ); } /* * Theme Options Panel */ $wp_customize->add_panel('butcher_meatshop_panel', array( 'priority' => 25, 'capability' => 'edit_theme_options', 'title' => __('Butcher Meatshop Theme Options', 'butcher-meatshop'), )); /* * Customizer main header section */ $wp_customize->add_setting( 'butcher_meatshop_site_title_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_site_title_text', array( 'label' => __('Enable Title', 'butcher-meatshop'), 'description' => __('Enable or Disable Title from the site', 'butcher-meatshop'), 'section' => 'title_tagline', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'butcher_meatshop_site_tagline_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_site_tagline_text', array( 'label' => __('Enable Tagline', 'butcher-meatshop'), 'description' => __('Enable or Disable Tagline from the site', 'butcher-meatshop'), 'section' => 'title_tagline', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'butcher_meatshop_logo_width', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '150', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_logo_width', array( 'label' => __('Logo Width in PX', 'butcher-meatshop'), 'section' => 'title_tagline', 'type' => 'number', 'input_attrs' => array( 'min' => 100, 'max' => 300, 'step' => 1, ), ) ); /* WooCommerce custom settings */ $wp_customize->add_section('woocommerce_custom_settings', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('WooCommerce Custom Settings', 'butcher-meatshop'), 'panel' => 'woocommerce', )); $wp_customize->add_setting( 'butcher_meatshop_per_columns', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_per_columns', array( 'label' => __('Product Per Single Row', 'butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 4, 'step' => 1, ), ) ); $wp_customize->add_setting( 'butcher_meatshop_product_per_page', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '6', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_product_per_page', array( 'label' => __('Product Per One Page', 'butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 12, 'step' => 1, ), ) ); /*Related Products Enable Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_related_product', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_related_product', array( 'label' => __('Enable Related Product', 'butcher-meatshop'), 'description' => __('Checked to show Related Product', 'butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'custom_related_products_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'custom_related_products_number', array( 'label' => __('Related Product Count', 'butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 20, 'step' => 1, ), ) ); $wp_customize->add_setting( 'custom_related_products_number_per_row', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'custom_related_products_number_per_row', array( 'label' => __('Related Product Per Row', 'butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 4, 'step' => 1, ), ) ); /*Archive Product layout*/ $wp_customize->add_setting('butcher_meatshop_archive_product_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_archive_product_layout',array( 'type' => 'select', 'label' => esc_html__('Archive Product Layout','butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','butcher-meatshop'), 'layout-2' => esc_html__('Sidebar On Left','butcher-meatshop') ), ) ); /*Single Product layout*/ $wp_customize->add_setting('butcher_meatshop_single_product_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_single_product_layout',array( 'type' => 'select', 'label' => esc_html__('Single Product Layout','butcher-meatshop'), 'section' => 'woocommerce_custom_settings', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','butcher-meatshop'), 'layout-2' => esc_html__('Sidebar On Left','butcher-meatshop') ), ) ); $wp_customize->add_setting('butcher_meatshop_woocommerce_product_sale',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Right', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_woocommerce_product_sale',array( 'label' => esc_html__( 'Woocommerce Product Sale Positions','butcher-meatshop' ), 'type' => 'select', 'section' => 'woocommerce_custom_settings', 'choices' => array( 'Right' => __('Right','butcher-meatshop'), 'Left' => __('Left','butcher-meatshop'), 'Center' => __('Center','butcher-meatshop') ), ) ); /*Additional Options*/ $wp_customize->add_section('butcher_meatshop_additional_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Additional Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); /*Main Slider Enable Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_preloader', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_preloader', array( 'label' => __('Enable Preloader', 'butcher-meatshop'), 'description' => __('Checked to show preloader', 'butcher-meatshop'), 'section' => 'butcher_meatshop_additional_section', 'type' => 'checkbox', ) ); /*Post layout*/ $wp_customize->add_setting('butcher_meatshop_archive_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_archive_layout',array( 'type' => 'select', 'label' => esc_html__('Posts Layout','butcher-meatshop'), 'section' => 'butcher_meatshop_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','butcher-meatshop'), 'layout-2' => esc_html__('Sidebar On Left','butcher-meatshop') ), ) ); /*single post layout*/ $wp_customize->add_setting('butcher_meatshop_post_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_post_layout',array( 'type' => 'select', 'label' => esc_html__('Single Post Layout','butcher-meatshop'), 'section' => 'butcher_meatshop_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','butcher-meatshop'), 'layout-2' => esc_html__('Sidebar On Left','butcher-meatshop') ), ) ); /*single page layout*/ $wp_customize->add_setting('butcher_meatshop_Page_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_Page_layout',array( 'type' => 'select', 'label' => esc_html__('Single Page Layout','butcher-meatshop'), 'section' => 'butcher_meatshop_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','butcher-meatshop'), 'layout-2' => esc_html__('Sidebar On Left','butcher-meatshop') ), ) ); /*Archive Post Options*/ $wp_customize->add_section('butcher_meatshop_blog_post_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Blog Page Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); $wp_customize->add_setting('butcher_meatshop_enable_blog_post_title',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_blog_post_title',array( 'label' => __('Enable Blog Post Title', 'butcher-meatshop'), 'description' => __('Checked To Show Blog Post Title', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('butcher_meatshop_enable_blog_post_meta',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_blog_post_meta',array( 'label' => __('Enable Blog Post Meta', 'butcher-meatshop'), 'description' => __('Checked To Show Blog Post Meta Feilds', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('butcher_meatshop_enable_blog_post_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_blog_post_image',array( 'label' => __('Enable Blog Post Image', 'butcher-meatshop'), 'description' => __('Checked To Show Blog Post Image', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('butcher_meatshop_enable_blog_post_content',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_blog_post_content',array( 'label' => __('Enable Blog Post Content', 'butcher-meatshop'), 'description' => __('Checked To Show Blog Post Content', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('butcher_meatshop_enable_blog_post_button',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_blog_post_button',array( 'label' => __('Enable Blog Post Read More Button', 'butcher-meatshop'), 'description' => __('Checked To Show Blog Post Read More Button', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'checkbox', )); /*Blog post Content layout*/ $wp_customize->add_setting('butcher_meatshop_blog_Post_content_layout',array( 'default' => 'Left', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_blog_Post_content_layout',array( 'type' => 'select', 'label' => esc_html__('Blog Post Content Layout','butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'choices' => array( 'Left' => esc_html__('Left','butcher-meatshop'), 'Center' => esc_html__('Center','butcher-meatshop'), 'Right' => esc_html__('Right','butcher-meatshop') ), ) ); /*Excerpt*/ $wp_customize->add_setting( 'butcher_meatshop_excerpt_limit', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '25', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_excerpt_limit', array( 'label' => __('Excerpt Limit', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 2, 'max' => 50, 'step' => 2, ), ) ); /*Archive Button Text*/ $wp_customize->add_setting( 'butcher_meatshop_read_more_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Continue Reading....', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_read_more_text', array( 'label' => __('Edit Button Text ', 'butcher-meatshop'), 'section' => 'butcher_meatshop_blog_post_section', 'type' => 'text', ) ); /*Single Post Options*/ $wp_customize->add_section('butcher_meatshop_single_post_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Single Post Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); $wp_customize->add_setting('butcher_meatshop_enable_single_post_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', )); $wp_customize->add_control('butcher_meatshop_enable_single_post_image',array( 'label' => __('Enable Single Post Image', 'butcher-meatshop'), 'description' => __('Checked To Show Single Post Image', 'butcher-meatshop'), 'section' => 'butcher_meatshop_single_post_section', 'type' => 'checkbox', )); /*Related Post Enable Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_related_post', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_related_post', array( 'label' => __('Enable Related Post', 'butcher-meatshop'), 'description' => __('Checked to show Related Post', 'butcher-meatshop'), 'section' => 'butcher_meatshop_single_post_section', 'type' => 'checkbox', ) ); /*Related post Edit Text*/ $wp_customize->add_setting( 'butcher_meatshop_related_post_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Related Post', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_related_post_text', array( 'label' => __('Edit Related Post Text ', 'butcher-meatshop'), 'section' => 'butcher_meatshop_single_post_section', 'type' => 'text', ) ); /*Related Post Per Page*/ $wp_customize->add_setting( 'butcher_meatshop_related_post_count', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_related_post_count', array( 'label' => __('Related Post Count', 'butcher-meatshop'), 'section' => 'butcher_meatshop_single_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 9, 'step' => 1, ), ) ); /* * Customizer Global COlor */ /*Global Color Options*/ $wp_customize->add_section('butcher_meatshop_global_color_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Global Color Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); $wp_customize->add_setting( 'butcher_meatshop_primary_color', array( 'default' => '#E3371A', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'butcher_meatshop_primary_color', array( 'label' => esc_html__( 'Primary Color', 'butcher-meatshop' ), 'section' => 'butcher_meatshop_global_color_section', 'settings' => 'butcher_meatshop_primary_color', ) ) ); $wp_customize->add_setting( 'butcher_meatshop_secondary_color', array( 'default' => '#001c27', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'butcher_meatshop_secondary_color', array( 'label' => esc_html__( 'Secondary Color', 'butcher-meatshop' ), 'section' => 'butcher_meatshop_global_color_section', 'settings' => 'butcher_meatshop_secondary_color', ) ) ); /*Main Header Options*/ $wp_customize->add_section('butcher_meatshop_header_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Main Header Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); /*Main Header Phone Text*/ $wp_customize->add_setting( 'butcher_meatshop_header_info_phone', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_header_info_phone', array( 'label' => __('Edit Phone Number ', 'butcher-meatshop'), 'section' => 'butcher_meatshop_header_section', 'type' => 'text', ) ); /*Main Header Phone Text*/ $wp_customize->add_setting( 'butcher_meatshop_header_info_email', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_header_info_email', array( 'label' => __('Edit Email Address ', 'butcher-meatshop'), 'section' => 'butcher_meatshop_header_section', 'type' => 'text', ) ); /*Main Header Address Text*/ $wp_customize->add_setting( 'butcher_meatshop_header_info_time', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_header_info_time', array( 'label' => __('Edit Time', 'butcher-meatshop'), 'section' => 'butcher_meatshop_header_section', 'type' => 'text', ) ); /* * Customizer main slider section */ /*Main Slider Options*/ $wp_customize->add_section('butcher_meatshop_slider_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Main Slider Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); /*Main Slider Enable Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_slider', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_slider', array( 'label' => __('Enable Main Slider', 'butcher-meatshop'), 'description' => __('Checked to show the main slider', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', 'type' => 'checkbox', ) ); for ($butcher_meatshop_i=1; $butcher_meatshop_i <= 3; $butcher_meatshop_i++) { /*Main Slider Image*/ $wp_customize->add_setting( 'butcher_meatshop_slider_image'.$butcher_meatshop_i, array( 'capability' => 'edit_theme_options', 'default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'butcher_meatshop_slider_image'.$butcher_meatshop_i, array( 'label' => __('Edit Slider Image ', 'butcher-meatshop') .$butcher_meatshop_i, 'description' => __('Edit the slider image.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', ) ) ); /*Main Slider Heading*/ $wp_customize->add_setting( 'butcher_meatshop_slider_heading'.$butcher_meatshop_i, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_slider_heading'.$butcher_meatshop_i, array( 'label' => __('Edit Heading Text ', 'butcher-meatshop') .$butcher_meatshop_i, 'description' => __('Edit the slider heading text.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', 'type' => 'text', ) ); /*Main Slider Content*/ $wp_customize->add_setting( 'butcher_meatshop_slider_text'.$butcher_meatshop_i, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_slider_text'.$butcher_meatshop_i, array( 'label' => __('Edit Content Text ', 'butcher-meatshop') .$butcher_meatshop_i, 'description' => __('Edit the slider content text.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', 'type' => 'text', ) ); /*Main Slider Button1 Text*/ $wp_customize->add_setting( 'butcher_meatshop_slider_button1_text'.$butcher_meatshop_i, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_slider_button1_text'.$butcher_meatshop_i, array( 'label' => __('Edit Button Text ', 'butcher-meatshop') .$butcher_meatshop_i, 'description' => __('Edit the slider button text.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', 'type' => 'text', ) ); /*Main Slider Button1 URL*/ $wp_customize->add_setting( 'butcher_meatshop_slider_button1_link'.$butcher_meatshop_i, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'butcher_meatshop_slider_button1_link'.$butcher_meatshop_i, array( 'label' => __('Edit Button URL ', 'butcher-meatshop') .$butcher_meatshop_i, 'description' => __('Edit the slider button url.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_slider_section', 'type' => 'url', ) ); } //gallerys Section $wp_customize->add_section('butcher_meatshop_service_section', array( 'priority' => 6, 'title' => __('Our Gallery Section', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', 'priority' => 7, )); $wp_customize->add_setting( 'butcher_meatshop_gallery_sec_enable', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_gallery_sec_enable', array( 'label' => __('Show / Hide Our Gallery Section', 'butcher-meatshop'), 'description' => __('Checked to enable Our Gallery option.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_service_section', 'type' => 'checkbox', ) ); $wp_customize->add_setting('butcher_meatshop_service_sub_heading', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('butcher_meatshop_service_sub_heading', array( 'label' => __('Add Gallery Heading', 'butcher-meatshop'), 'section' => 'butcher_meatshop_service_section', 'type' => 'text' )); $wp_customize->add_setting('butcher_meatshop_service_about_us', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('butcher_meatshop_service_about_us', array( 'label' => __('Add Gallery Content', 'butcher-meatshop'), 'section' => 'butcher_meatshop_service_section', 'type' => 'text' )); // banner1 $wp_customize->add_setting('butcher_meatshop_gallery_first',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_first',array( 'label' => __('Select Banner Image 1','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); // banner2 $wp_customize->add_setting('butcher_meatshop_gallery_sec',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_sec',array( 'label' => __('Select Banner Image 2','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); // middle banner $wp_customize->add_setting('butcher_meatshop_gallery_third',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_third',array( 'label' => __('Select Banner Image 3','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); // 4th banner $wp_customize->add_setting('butcher_meatshop_gallery_fourth',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_fourth',array( 'label' => __('Select Banner Image 4','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); // 5th banner $wp_customize->add_setting('butcher_meatshop_gallery_fifth',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_fifth',array( 'label' => __('Select Banner Image 5','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); $wp_customize->add_setting('butcher_meatshop_gallery_sixth',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_gallery_sixth',array( 'label' => __('Select Banner Image 6','butcher-meatshop'), 'section' => 'butcher_meatshop_service_section' ))); /* * Customizer Footer Section */ /*Footer Options*/ $wp_customize->add_section('butcher_meatshop_footer_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Footer Options', 'butcher-meatshop'), 'panel' => 'butcher_meatshop_panel', )); /*Footer Enable Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_footer', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_footer', array( 'label' => __('Enable Footer', 'butcher-meatshop'), 'description' => __('Checked to show Footer', 'butcher-meatshop'), 'section' => 'butcher_meatshop_footer_section', 'type' => 'checkbox', ) ); /*Footer bg image Option*/ $wp_customize->add_setting('butcher_meatshop_footer_bg_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'butcher_meatshop_footer_bg_image',array( 'label' => __('Footer Background Image','butcher-meatshop'), 'section' => 'butcher_meatshop_footer_section', 'priority' => 1, ))); /*Footer Social Menu Option*/ $wp_customize->add_setting( 'butcher_meatshop_footer_social_menu', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_footer_social_menu', array( 'label' => __('Enable Footer Social Menu', 'butcher-meatshop'), 'description' => __('Checked to show the footer social menu. Go to Dashboard >> Appearance >> Menus >> Create New Menu >> Add Custom Link >> Add Social Menu >> Checked Social Menu >> Save Menu.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_footer_section', 'type' => 'checkbox', ) ); /*Go To Top Option*/ $wp_customize->add_setting( 'butcher_meatshop_enable_go_to_top_option', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'butcher_meatshop_sanitize_checkbox', ) ); $wp_customize->add_control( 'butcher_meatshop_enable_go_to_top_option', array( 'label' => __('Enable Go To Top', 'butcher-meatshop'), 'description' => __('Checked to enable Go To Top option.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_footer_section', 'type' => 'checkbox', ) ); $wp_customize->add_setting('butcher_meatshop_go_to_top_position',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Right', 'sanitize_callback' => 'butcher_meatshop_sanitize_choices' )); $wp_customize->add_control('butcher_meatshop_go_to_top_position',array( 'type' => 'select', 'section' => 'butcher_meatshop_footer_section', 'label' => esc_html__('Go To Top Positions','butcher-meatshop'), 'choices' => array( 'Right' => __('Right','butcher-meatshop'), 'Left' => __('Left','butcher-meatshop'), 'Center' => __('Center','butcher-meatshop') ), ) ); /*Footer Copyright Text Enable*/ $wp_customize->add_setting( 'butcher_meatshop_copyright_option', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'butcher_meatshop_copyright_option', array( 'label' => __('Edit Copyright Text', 'butcher-meatshop'), 'description' => __('Edit the Footer Copyright Section.', 'butcher-meatshop'), 'section' => 'butcher_meatshop_footer_section', 'type' => 'text', ) ); } add_action( 'customize_register', 'Butcher_Meatshop_Customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function Butcher_Meatshop_Customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function Butcher_Meatshop_Customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function Butcher_Meatshop_Customize_preview_js() { wp_enqueue_script( 'butcher-meatshop-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), BUTCHER_MEATSHOP_VERSION, true ); } add_action( 'customize_preview_init', 'Butcher_Meatshop_Customize_preview_js' ); /** * Singleton class for handling the theme's customizer integration. * * @since 1.0.0 * @access public */ final class Butcher_Meatshop_Customize { /** * Returns the instance. * * @since 1.0.0 * @access public * @return object */ public static function get_instance() { static $butcher_meatshop_instance = null; if ( is_null( $butcher_meatshop_instance ) ) { $butcher_meatshop_instance = new self; $butcher_meatshop_instance->setup_actions(); } return $butcher_meatshop_instance; } /** * Constructor method. * * @since 1.0.0 * @access private * @return void */ private function __construct() {} /** * Sets up initial actions. * * @since 1.0.0 * @access private * @return void */ private function setup_actions() { // Register panels, sections, settings, controls, and partials. add_action( 'customize_register', array( $this, 'sections' ) ); // Register scripts and styles for the controls. add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 ); } /** * Sets up the customizer sections. * * @since 1.0.0 * @access public * @param object $butcher_meatshop_manager * @return void */ public function sections( $butcher_meatshop_manager ) { // Load custom sections. load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' ); // Register custom section types. $butcher_meatshop_manager->register_section_type( 'Butcher_Meatshop_Customize_Section_Pro' ); // Register sections. $butcher_meatshop_manager->add_section( new Butcher_Meatshop_Customize_Section_Pro( $butcher_meatshop_manager,'butcher_meatshop_go_pro', array( 'priority' => 1, 'title' => esc_html__( 'Butcher Meatshop Pro', 'butcher-meatshop' ), 'pro_text' => esc_html__( 'Buy Pro', 'butcher-meatshop' ), 'pro_url' => esc_url( BUTCHER_MEATSHOP_BUY_NOW ), ) ) ); // Register sections. $butcher_meatshop_manager->add_section( new Butcher_Meatshop_Customize_Section_Pro( $butcher_meatshop_manager,'butcher_meatshop_lite_documentation', array( 'priority' => 1, 'title' => esc_html__( 'Lite Documentation', 'butcher-meatshop' ), 'pro_text' => esc_html__( 'Instruction', 'butcher-meatshop' ), 'pro_url' => esc_url( BUTCHER_MEATSHOP_LITE_DOC ), ) ) ); $butcher_meatshop_manager->add_section( new Butcher_Meatshop_Customize_Section_Pro( $butcher_meatshop_manager, 'butcher_meatshop_live_demo', array( 'priority' => 1, 'title' => esc_html__( 'Pro Theme Demo', 'butcher-meatshop' ), 'pro_text' => esc_html__( 'Live Preview', 'butcher-meatshop' ), 'pro_url' => esc_url( BUTCHER_MEATSHOP_LIVE_DEMO ), ) ) ); } /** * Loads theme customizer CSS. * * @since 1.0.0 * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script( 'butcher-meatshop-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) ); wp_enqueue_style( 'butcher-meatshop-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' ); } } // Doing this customizer thang! Butcher_Meatshop_Customize::get_instance();