remove_section( 'food_grocery_store_upgrade_pro_link' ); $wp_customize->remove_section( 'food_grocery_store_get_started_link' ); $wp_customize->remove_setting( 'food_grocery_store_daily_deals_text' ); $wp_customize->remove_control( 'food_grocery_store_daily_deals_text' ); $wp_customize->remove_setting( 'food_grocery_store_daily_deals_link' ); $wp_customize->remove_control( 'food_grocery_store_daily_deals_link' ); $wp_customize->remove_setting( 'food_grocery_store_contact_text' ); $wp_customize->remove_control( 'food_grocery_store_contact_text' ); $wp_customize->remove_setting( 'food_grocery_store_contact_link' ); $wp_customize->remove_control( 'food_grocery_store_contact_link' ); $wp_customize->remove_control( 'food_grocery_store_slider_content_hide_show' ); } add_action( 'customize_register', 'online_grocery_mart_customize_register', 11 ); function online_grocery_mart_header_style() { if ( get_header_image() ) : $custom_css = " .home-page-header{ background-image:url('".esc_url(get_header_image())."'); background-position: center top; background-size: 100%; }"; wp_add_inline_style( 'online-grocery-mart-style', $custom_css ); endif; } add_action( 'wp_enqueue_scripts', 'online_grocery_mart_header_style' ); function online_grocery_mart_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', 'online_grocery_mart_scripts' ); function online_grocery_mart_customizer ( $wp_customize ) { // Header $wp_customize->add_setting('online_grocery_mart_discount_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('online_grocery_mart_discount_text',array( 'label' => esc_html__('Discount Text','online-grocery-mart'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Discount Text', 'online-grocery-mart' ), ), 'section'=> 'food_grocery_store_top_header', 'type'=> 'text' )); $wp_customize->add_setting('online_grocery_mart_email_address',array( 'default'=> '', 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('online_grocery_mart_email_address',array( 'label' => esc_html__('Email Address','online-grocery-mart'), 'input_attrs' => array( 'placeholder' => esc_html__( 'example@support123.com', 'online-grocery-mart' ), ), 'section'=> 'food_grocery_store_top_header', 'type'=> 'text' )); $wp_customize->add_setting('online_grocery_mart_hot_deal_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('online_grocery_mart_hot_deal_text',array( 'label' => esc_html__('Hot Deals Text','online-grocery-mart'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Hot Deals', 'online-grocery-mart' ), ), 'section'=> 'food_grocery_store_top_header', 'type'=> 'text' )); $wp_customize->add_setting('online_grocery_mart_hot_deal_link',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('online_grocery_mart_hot_deal_link',array( 'label' => esc_html__('Hot Deals Link','online-grocery-mart'), 'input_attrs' => array( 'placeholder' => esc_html__( 'https://example.com/page', 'online-grocery-mart' ), ), 'section'=> 'food_grocery_store_top_header', 'type'=> 'url' )); // Product Section $wp_customize->add_section( 'online_grocery_mart_best_deal_section' , array( 'title' => esc_html__( 'Product Section', 'online-grocery-mart' ), 'description' => "For more options of product section GO PRO", 'panel' => 'food_grocery_store_panel_id', 'priority' => 5, ) ); $wp_customize->add_setting('online_grocery_mart_best_deal_number',array( 'default'=> '', 'sanitize_callback' => 'absint' )); $wp_customize->add_control('online_grocery_mart_best_deal_number',array( 'label' => esc_html__('Number of Product','online-grocery-mart'), 'section'=> 'online_grocery_mart_best_deal_section', 'type'=> 'number' )); $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( $args ); $cats = array(); $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cats[$category->slug] = $category->name; } $wp_customize->add_setting('online_grocery_mart_best_deal',array( 'sanitize_callback' => 'online_grocery_mart_sanitize_select', )); $wp_customize->add_control('online_grocery_mart_best_deal',array( 'type' => 'select', 'choices' => $cats, 'label' => __('Select Product Category','online-grocery-mart'), 'section' => 'online_grocery_mart_best_deal_section', )); // Color Option $wp_customize->add_setting( 'online_grocery_mart_second_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'online_grocery_mart_second_color', array( 'label' => esc_html__('Color Option', 'online-grocery-mart'), 'description' => esc_html__('It will change the complete theme color in one click.', 'online-grocery-mart'), 'section' => 'food_grocery_store_global_typography', 'settings' => 'online_grocery_mart_second_color', ))); } add_action( 'customize_register', 'online_grocery_mart_customizer' ); //define define('ONLINE_GROCERY_MART_FREE_THEME_DOC',__('https://vwthemesdemo.com/docs/free-food-grocery-store/','online-grocery-mart')); define('ONLINE_GROCERY_MART_SUPPORT',__('https://wordpress.org/support/theme/online-grocery-mart/','online-grocery-mart')); define('ONLINE_GROCERY_MART_REVIEW',__('https://wordpress.org/support/theme/online-grocery-mart/reviews/','online-grocery-mart')); define('ONLINE_GROCERY_MART_BUY_NOW',__('https://www.vwthemes.com/themes/online-grocery-shopping-wordpress-theme/','online-grocery-mart')); define('ONLINE_GROCERY_MART_LIVE_DEMO',__('https://www.vwthemes.net/online-grocery-shopping-pro/','online-grocery-mart')); define('ONLINE_GROCERY_MART_PRO_DOC',__('https://vwthemesdemo.com/docs/food-grocery-store-pro/','online-grocery-mart')); define('ONLINE_GROCERY_MART_FAQ',__('https://www.vwthemes.com/faqs/','online-grocery-mart')); define('ONLINE_GROCERY_MART_CONTACT',__('https://www.vwthemes.com/contact/','online-grocery-mart')); define('ONLINE_GROCERY_MART_CHILD_THEME',__('https://developer.wordpress.org/themes/advanced-topics/child-themes/','online-grocery-mart')); define('ONLINE_GROCERY_MART_CREDIT',__('https://www.vwthemes.com/themes/free-online-grocery-wordpress-theme/','online-grocery-mart')); if ( ! function_exists( 'online_grocery_mart_credit' ) ) { function online_grocery_mart_credit(){ echo "".esc_html__('Online Grocery WordPress Theme','online-grocery-mart').""; } } if ( ! defined( 'FOOD_GROCERY_STORE_GO_PRO_URL' ) ) { define( 'FOOD_GROCERY_STORE_GO_PRO_URL', 'https://www.vwthemes.com/themes/online-grocery-shopping-wordpress-theme/'); } function online_grocery_mart_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 ); } // Customizer Pro load_template( ABSPATH . WPINC . '/class-wp-customize-section.php' ); class Online_Grocery_Mart_Customize_Section_Pro extends WP_Customize_Section { public $type = 'online-grocery-mart'; 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 Online Grocery Mart Theme. Would like to have you on our Welcome page so that you can reap all the benefits of our Online Grocery Mart Theme.', 'online-grocery-mart' ) .'
'; echo ''. esc_html__( 'GET STARTED', 'online-grocery-mart' ) .''; echo ''. esc_html__( 'VIEW DEMO', 'online-grocery-mart' ) .''; echo ''. esc_html__( 'UPGRADE PRO', 'online-grocery-mart' ) .''; echo '