remove_setting( 'vw_bakery_topbar_hide_show' ); $wp_customize->remove_control( 'vw_bakery_topbar_hide_show' ); $wp_customize->remove_setting( 'vw_bakery_topbar_padding_top_bottom' ); $wp_customize->remove_control( 'vw_bakery_topbar_padding_top_bottom' ); $wp_customize->remove_setting( 'vw_bakery_search_hide_show' ); $wp_customize->remove_control( 'vw_bakery_search_hide_show' ); $wp_customize->remove_setting( 'vw_bakery_search_font_size' ); $wp_customize->remove_control( 'vw_bakery_search_font_size' ); $wp_customize->remove_setting( 'vw_bakery_location_address_icon' ); $wp_customize->remove_control( 'vw_bakery_location_address_icon' ); $wp_customize->remove_setting( 'vw_bakery_location' ); $wp_customize->remove_control( 'vw_bakery_location' ); $wp_customize->remove_setting( 'vw_bakery_timing_icon' ); $wp_customize->remove_control( 'vw_bakery_timing_icon' ); $wp_customize->remove_setting( 'vw_bakery_opening_text' ); $wp_customize->remove_control( 'vw_bakery_opening_text' ); $wp_customize->remove_setting( 'vw_bakery_opening_time' ); $wp_customize->remove_control( 'vw_bakery_opening_time' ); $wp_customize->remove_setting( 'vw_bakery_contact_link' ); $wp_customize->remove_control( 'vw_bakery_contact_link' ); $wp_customize->remove_setting( 'vw_bakery_cart_icon' ); $wp_customize->remove_control( 'vw_bakery_cart_icon' ); $wp_customize->remove_setting( 'vw_bakery_resp_topbar_hide_show' ); $wp_customize->remove_control( 'vw_bakery_resp_topbar_hide_show' ); $wp_customize->remove_setting( 'vw_bakery_stickyheader_hide_show' ); $wp_customize->remove_control( 'vw_bakery_stickyheader_hide_show' ); $wp_customize->remove_setting( 'vw_bakery_sticky_header' ); $wp_customize->remove_control( 'vw_bakery_sticky_header' ); $wp_customize->remove_setting( 'vw_bakery_sticky_header_padding' ); $wp_customize->remove_control( 'vw_bakery_sticky_header_padding' ); $wp_customize->remove_setting( 'vw_bakery_contact_button_text' ); $wp_customize->remove_control( 'vw_bakery_contact_button_text' ); $wp_customize->remove_setting( 'vw_bakery_slider_button_text' ); $wp_customize->remove_control( 'vw_bakery_slider_button_text' ); $wp_customize->remove_setting( 'vw_bakery_slider_content_hide_show' ); $wp_customize->remove_control( 'vw_bakery_slider_content_hide_show' ); } add_action( 'customize_register', 'cafe_coffee_shop_customize_register', 11 ); function cafe_coffee_shop_header_style() { if ( get_header_image() ) : $custom_css = " #header{ background-image:url('".esc_url(get_header_image())."'); background-position: center top; background-size: 100%; }"; wp_add_inline_style( 'cafe-coffee-shop-style', $custom_css ); endif; } add_action( 'wp_enqueue_scripts', 'cafe_coffee_shop_header_style' ); function cafe_coffee_shop_scripts() { wp_enqueue_script( 'Custom JS ', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery') ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'cafe_coffee_shop_scripts' ); function cafe_coffee_shop_font_url() { $font_url = ''; $font_family = array(); $font_family[] = 'Playfair Display:400,400i,500,500i,600,600i,700,700i,800,800i,900,900i'; $font_family[] = 'Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i'; $query_args = array( 'family' => rawurlencode(implode('|',$font_family)), ); $font_url = add_query_arg($query_args,'//fonts.googleapis.com/css'); return $font_url; $contents = wptt_get_webfont_url( esc_url_raw( $fonts_url ) ); } function cafe_coffee_shop_customizer ( $wp_customize ) { //Slider $wp_customize->add_setting('cafe_coffee_shop_slider_go_btn',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('cafe_coffee_shop_slider_go_btn',array( 'description' => __('GO PRO','cafe-coffee-shop'), 'section'=> 'vw_bakery_slidersettings', 'type'=> 'hidden' )); //About section $wp_customize->add_section( 'cafe_coffee_shop_about_section' , array( 'title' => __( 'About us Section', 'cafe-coffee-shop' ), 'priority' => 20, 'panel' => 'vw_bakery_panel_id' ) ); $wp_customize->add_setting('cafe_coffee_shop_section_title',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('cafe_coffee_shop_section_title',array( 'label' => __('Add Section Text','cafe-coffee-shop'), 'input_attrs' => array( 'placeholder' => __( 'OUR STORY', 'cafe-coffee-shop' ), ), 'section'=> 'cafe_coffee_shop_about_section', 'type'=> 'text' )); $wp_customize->add_setting( 'cafe_coffee_shop_about_page' , array( 'default' => '', 'sanitize_callback' => 'cafe_coffee_shop_sanitize_dropdown_pages' ) ); $wp_customize->add_control( 'cafe_coffee_shop_about_page' , array( 'label' => __( 'Select About Page', 'cafe-coffee-shop' ), 'section' => 'cafe_coffee_shop_about_section', 'type' => 'dropdown-pages' ) ); $wp_customize->add_setting( 'cafe_coffee_shop_about_excerpt_number', array( 'default' => 30, 'transport' => 'refresh', 'sanitize_callback' => 'cafe_coffee_shop_sanitize_number_range' ) ); $wp_customize->add_control( 'cafe_coffee_shop_about_excerpt_number', array( 'label' => esc_html__( 'About Excerpt length','cafe-coffee-shop' ), 'section' => 'cafe_coffee_shop_about_section', 'type' => 'range', 'settings' => 'cafe_coffee_shop_about_excerpt_number', 'input_attrs' => array( 'step' => 5, 'min' => 0, 'max' => 50, ), ) ); } add_action( 'customize_register', 'cafe_coffee_shop_customizer' ); define('CAFE_COFFEE_SHOP_FREE_THEME_DOC',__('https://www.vwthemesdemo.com/docs/free-cafe-coffee-shop/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_SUPPORT',__('https://wordpress.org/support/theme/cafe-coffee-shop/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_REVIEW',__('https://wordpress.org/support/theme/cafe-coffee-shop/reviews','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_BUY_NOW',__('https://www.vwthemes.com/themes/cafe-wordpress-theme/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_LIVE_DEMO',__('https://www.vwthemes.net/vw-cafe/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_PRO_DOC',__('https://www.vwthemesdemo.com/docs/vw-cafe-pro/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_FAQ',__('https://www.vwthemes.com/faqs/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_CONTACT',__('https://www.vwthemes.com/contact/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_CHILD_THEME',__('https://developer.wordpress.org/themes/advanced-topics/child-themes/','cafe-coffee-shop')); define('CAFE_COFFEE_SHOP_CREDIT',__('https://www.vwthemes.com/themes/free-cafe-wordpress-theme/','cafe-coffee-shop')); if ( ! function_exists( 'cafe_coffee_shop_credit' ) ) { function cafe_coffee_shop_credit(){ echo "".esc_html__('Cafe WordPress Theme','cafe-coffee-shop').""; } } /** * Enqueue block editor style */ function cafe_coffee_shop_block_editor_styles() { wp_enqueue_style( 'cafe-coffee-shop-font', cafe_coffee_shop_font_url(), array() ); wp_enqueue_style( 'cafe-coffee-shop-block-patterns-style-editor', get_theme_file_uri( '/inc/block-patterns/css/block-editor.css' ), false, '1.0', 'all' ); } add_action( 'enqueue_block_editor_assets', 'cafe_coffee_shop_block_editor_styles' ); function cafe_coffee_shop_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } } function cafe_coffee_shop_sanitize_select( $input, $setting ){ $input = sanitize_key($input); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } function cafe_coffee_shop_sanitize_dropdown_pages( $page_id, $setting ) { $page_id = absint( $page_id ); return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default ); } function cafe_coffee_shop_sanitize_number_range( $number, $setting ) { $number = absint( $number ); $atts = $setting->manager->get_control( $setting->id )->input_attrs; $min = ( isset( $atts['min'] ) ? $atts['min'] : $number ); $max = ( isset( $atts['max'] ) ? $atts['max'] : $number ); $step = ( isset( $atts['step'] ) ? $atts['step'] : 1 ); return ( $min <= $number && $number <= $max && is_int( $number / $step ) ? $number : $setting->default ); } // Customizer Pro load_template( ABSPATH . WPINC . '/class-wp-customize-section.php' ); class Cafe_Coffee_Shop_Customize_Section_Pro extends WP_Customize_Section { public $type = 'cafe-coffee-shop'; public $pro_text = ''; public $pro_url = ''; public function json() { $json = parent::json(); $json['pro_text'] = $this->pro_text; $json['pro_url'] = esc_url( $this->pro_url ); return $json; } protected function render_template() { ?>
'. esc_html__( 'Thank you for choosing Cafe Coffee Shop Theme. Would like to have you on our Welcome page so that you can reap all the benefits of our Cafe Coffee Shop Theme.', 'cafe-coffee-shop' ) .'
'; echo ''. esc_html__( 'GET STARTED', 'cafe-coffee-shop' ) .''; echo ''. esc_html__( 'VIEW DEMO', 'cafe-coffee-shop' ) .''; echo ''. esc_html__( 'UPGRADE PRO', 'cafe-coffee-shop' ) .''; echo '