From 47d225488678aae033e4805d2e7f34e280a5db2a Mon Sep 17 00:00:00 2001 From: francgrasso Date: Fri, 22 May 2020 16:51:16 +0200 Subject: [PATCH] version 1.2.7 * New options for main menu color * New mobile menu position to use a different menu between desktop and mobile * New login widget * Move all customizer css from php file to css variables to reduce page impact, load time and increase performance * Fix search widget button alignment * Fix issue with header background color * Enanched support to: Group block, Cover block, WooCommerce products block * Improve cart shipping calculator css * Refactor all scss files --- functions.php | 18 +- header.php | 20 +- img/user.svg | 7 + inc/customizer-inline-style.php | 5 + inc/customizer.php | 38 +++ inc/utils.php | 18 +- inc/widgets.php | 12 + .../class-yith-proteo-account-widget.php | 222 ++++++++++++++++++ readme.txt | 13 +- sass/layout/_header.scss | 8 +- sass/navigation/_menus.scss | 12 +- sass/responsive.scss | 12 + sass/shop/_widgets.scss | 2 +- sass/site/secondary/_widgets.scss | 21 ++ sass/style.scss | 4 +- sass/third-party/cf7.scss | 3 + style.css | 65 ++++- style.css.map | 2 +- 18 files changed, 457 insertions(+), 25 deletions(-) create mode 100644 img/user.svg create mode 100644 inc/widgets/class-yith-proteo-account-widget.php diff --git a/functions.php b/functions.php index b39804c..41f8520 100644 --- a/functions.php +++ b/functions.php @@ -48,10 +48,22 @@ function yith_proteo_setup() { // This theme uses wp_nav_menu() in one location. register_nav_menus( array( - 'menu-1' => esc_html__( 'Primary', 'yith-proteo' ), + 'primary' => esc_html__( 'Primary', 'yith-proteo' ), + 'mobile' => esc_html__( 'Mobile Menu', 'yith-proteo' ), ) ); + /** + * Fix empty menu locations + */ + $menu_locations = get_theme_mod( 'nav_menu_locations' ); + if ( ! isset( $menu_locations['primary'] ) && isset( $menu_locations['menu-1'] ) ) { + set_theme_mod( 'nav_menu_locations', array_merge( $menu_locations, array( 'primary' => $menu_locations['menu-1'] ) ) ); + } + if ( ! isset( $menu_locations['mobile'] ) ) { + set_theme_mod( 'nav_menu_locations', array_merge( $menu_locations, array( 'mobile' => $menu_locations['primary'] ) ) ); + } + /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. @@ -189,7 +201,9 @@ function yith_proteo_content_width() { /** * Load TGM class */ -require_once get_template_directory() . '/third-party/classes/class-tgm-plugin-activation.php'; +if ( ! class_exists( 'TGM_Plugin_Activation' ) ) { + require_once get_template_directory() . '/third-party/classes/class-tgm-plugin-activation.php'; +} /** * Various functions diff --git a/header.php b/header.php index 373f380..a706e76 100644 --- a/header.php +++ b/header.php @@ -30,10 +30,16 @@ } else { $hide_header = $post ? get_post_meta( $post->ID, 'yith_proteo_remove_header_and_footer', true ) : 'off'; } + $slider = ''; + if ( defined( 'YITH_SLIDER_FOR_PAGE_BUILDERS' ) ) { + if ( $post ) { + $slider = get_post_meta( $post->ID, 'header_slider', true ); + } + } if ( 'on' != $hide_header ) : ?>