esc_html__('Main Menu', 'envo-storefront'), ) ); add_theme_support('post-thumbnails'); set_post_thumbnail_size(300, 300, true); add_image_size('envo-storefront-single', 1140, 641, true); add_image_size('envo-storefront-med', 720, 405, true); // Add Custom Background Support. $args = array( 'default-color' => 'ffffff', ); add_theme_support('custom-background', $args); add_theme_support('custom-logo', array( 'height' => 60, 'width' => 200, 'flex-height' => true, 'flex-width' => true, 'header-text' => array('site-title', 'site-description'), )); // Adds RSS feed links to for posts and comments. add_theme_support('automatic-feed-links'); /* * Let WordPress manage the document title. */ add_theme_support('title-tag'); // Set the default content width. $GLOBALS['content_width'] = 1140; add_theme_support('custom-header', apply_filters('envo_storefront_custom_header_args', array( 'width' => 2000, 'height' => 200, 'default-text-color' => '', 'wp-head-callback' => 'envo_storefront_header_style', ))); // WooCommerce support. add_theme_support('woocommerce'); add_theme_support('wc-product-gallery-zoom'); add_theme_support('wc-product-gallery-lightbox'); add_theme_support('wc-product-gallery-slider'); add_theme_support('html5', array('search-form')); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style(array('css/bootstrap.css', envo_storefront_fonts_url(), 'css/editor-style.css')); // Recommend plugins. add_theme_support('recommend-plugins', array( 'envo-extra' => array( 'name' => 'Envo Extra', 'active_filename' => 'envo-extra/envo-extra.php', 'description' => esc_html__('Save time by importing our demo data: your website will be set up and ready to be customized in minutes.', 'envo-storefront'), ), 'woocommerce' => array( 'name' => 'WooCommerce', 'active_filename' => 'woocommerce/woocommerce.php', /* translators: %s plugin name string */ 'description' => sprintf(esc_attr__('To enable shop features, please install and activate the %s plugin.', 'envo-storefront'), 'WooCommerce'), ), 'elementor' => array( 'name' => 'Elementor', 'active_filename' => 'elementor/elementor.php', /* translators: %s plugin name string */ 'description' => sprintf(esc_attr__('The most advanced frontend drag & drop page builder.', 'envo-storefront'), 'Elementor'), ), )); } endif; if (!function_exists('envo_storefront_header_style')) : /** * Styles the header image and text displayed on the blog. */ function envo_storefront_header_style() { $header_image = get_header_image(); $header_text_color = get_header_textcolor(); if (get_theme_support('custom-header', 'default-text-color') !== $header_text_color || !empty($header_image)) { ?> ' . "\n", esc_url(get_bloginfo('pingback_url'))); } } add_action('wp_head', 'envo_storefront_pingback_header'); /** * Set Content Width */ function envo_storefront_content_width() { $content_width = $GLOBALS['content_width']; if (is_active_sidebar('envo-storefront-right-sidebar')) { $content_width = 750; } else { $content_width = 1040; } /** * Filter content width of the theme. */ $GLOBALS['content_width'] = apply_filters('envo_storefront_content_width', $content_width); } add_action('template_redirect', 'envo_storefront_content_width', 0); /** * Register custom fonts. */ function envo_storefront_fonts_url() { $fonts_url = ''; /** * Translators: If there are characters in your language that are not * supported by Open Sans Condensed, translate this to 'off'. Do not translate * into your own language. */ $font = _x('on', 'Open Sans Condensed font: on or off', 'envo-storefront'); if ('off' !== $font) { $font_families = array(); $font_families[] = 'Open Sans Condensed:300,500,700'; $query_args = array( 'family' => urlencode(implode('|', $font_families)), 'subset' => urlencode('cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese'), ); $fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); } return esc_url_raw($fonts_url); } /** * Add preconnect for Google Fonts. */ function envo_storefront_resource_hints($urls, $relation_type) { if (wp_style_is('envo-storefront-fonts', 'queue') && 'preconnect' === $relation_type) { $urls[] = array( 'href' => 'https://fonts.gstatic.com', 'crossorigin', ); } return $urls; } add_filter('wp_resource_hints', 'envo_storefront_resource_hints', 10, 2); /** * Enqueue Styles (normal style.css and bootstrap.css) */ function envo_storefront_theme_stylesheets() { // Add custom fonts, used in the main stylesheet. wp_enqueue_style('envo-storefront-fonts', envo_storefront_fonts_url(), array(), null); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '3.3.7'); wp_enqueue_style('mmenu-light', get_template_directory_uri() . '/css/mmenu-light.min.css', array(), ENVO_STOREFRONT_VERSION); // Theme stylesheet. wp_enqueue_style('envo-storefront-stylesheet', get_stylesheet_uri(), array('bootstrap'), ENVO_STOREFRONT_VERSION); // Load Font Awesome css. wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0'); } add_action('wp_enqueue_scripts', 'envo_storefront_theme_stylesheets'); /** * Register Bootstrap JS with jquery */ function envo_storefront_theme_js() { wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.7', true); wp_enqueue_script('envo-storefront-theme-js', get_template_directory_uri() . '/js/customscript.js', array('jquery'), ENVO_STOREFRONT_VERSION, true); wp_enqueue_script('mmenu', get_template_directory_uri() . '/js/mmenu-light.min.js', array('jquery'), ENVO_STOREFRONT_VERSION, true); } add_action('wp_enqueue_scripts', 'envo_storefront_theme_js'); if (!function_exists('envo_storefront_is_pro_activated')) { /** * Query Envo Storefront activation */ function envo_storefront_is_pro_activated() { return defined('ENVO_STOREFRONT_PRO_CURRENT_VERSION') ? true : false; } } /** * Register Custom Navigation Walker include custom menu widget to use walkerclass */ require_once( trailingslashit(get_template_directory()) . 'lib/wp_bootstrap_navwalker.php' ); /** * Register Theme Info Page */ require_once( trailingslashit(get_template_directory()) . 'lib/dashboard.php' ); /** * Customizer options */ require_once( trailingslashit(get_template_directory()) . 'lib/customizer.php' ); if (class_exists('WooCommerce')) { /** * WooCommerce options */ require_once( trailingslashit(get_template_directory()) . 'lib/woocommerce.php' ); } add_action('widgets_init', 'envo_storefront_widgets_init'); /** * Register the Sidebar(s) */ function envo_storefront_widgets_init() { register_sidebar( array( 'name' => esc_html__('Sidebar', 'envo-storefront'), 'id' => 'envo-storefront-right-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Top Bar Section', 'envo-storefront'), 'id' => 'envo-storefront-top-bar-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Header Section', 'envo-storefront'), 'id' => 'envo-storefront-header-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Footer Section', 'envo-storefront'), 'id' => 'envo-storefront-footer-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } function envo_storefront_main_content_width_columns() { $columns = '12'; if (is_active_sidebar('envo-storefront-right-sidebar')) { $columns = $columns - 3; } echo absint($columns); } if (!function_exists('envo_storefront_entry_footer')) : /** * Prints HTML with meta information for the categories, tags and comments. */ function envo_storefront_entry_footer() { // Get Categories for posts. $categories_list = get_the_category_list(' '); // Get Tags for posts. $tags_list = get_the_tag_list('', ' '); // We don't want to output .entry-footer if it will be empty, so make sure its not. if ($categories_list || $tags_list || get_edit_post_link()) { echo '
'; if ('post' === get_post_type()) { if ($categories_list || $tags_list) { // Make sure there's more than one category before displaying. if ($categories_list) { echo ''; } if ($tags_list) { echo ''; } } } edit_post_link(); echo '
'; } } endif; if (!function_exists('envo_storefront_generate_construct_footer')) : /** * Build footer */ add_action('envo_storefront_generate_footer', 'envo_storefront_generate_construct_footer'); function envo_storefront_generate_construct_footer() { ?>
'' . __('Previous Post', 'envo-storefront') . ' %title', 'next_text' => '' . __('Next Post', 'envo-storefront') . ' %title', ) ); } endif; /** * Post author meta funciton */ if (!function_exists('envo_storefront_author_meta')) : function envo_storefront_author_meta() { ?> tag. * */ do_action('wp_body_open'); } endif; /** * Skip to content link */ function envo_storefront_skip_link() { echo ''; } add_action( 'wp_body_open', 'envo_storefront_skip_link', 5 );