diff --git a/functions.php b/functions.php index 6c7cd01..b4c0411 100644 --- a/functions.php +++ b/functions.php @@ -175,9 +175,7 @@ function polestar_scripts() { wp_enqueue_style( 'polestar-style', get_template_directory_uri() . '/style' . PURO_THEME_CSS_PREFIX . '.css', array(), PURO_THEME_VERSION ); // FitVids. - if ( ! ( function_exists( 'has_blocks' ) && has_blocks() ) ) { - wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.1', true ); - } + wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.1', true ); // Flexslider. wp_register_script( 'jquery-flexslider', get_template_directory_uri() . '/js/jquery.flexslider' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '2.6.3', true ); diff --git a/inc/customizer-library b/inc/customizer-library index 7d9b22f..19f18b2 160000 --- a/inc/customizer-library +++ b/inc/customizer-library @@ -1 +1 @@ -Subproject commit 7d9b22fe9d7817fe2f6c5266e06aa6374e2f7399 +Subproject commit 19f18b2c3f81fbd2418abd568116aa6f9b0c46a5 diff --git a/inc/deprecated.php b/inc/deprecated.php index f2b217e..c4c3ec7 100644 --- a/inc/deprecated.php +++ b/inc/deprecated.php @@ -6,17 +6,6 @@ * @license GPL 2.0 */ -if ( ! function_exists( 'polestar_excerpt_length' ) ) : -/** - * Filter the excerpt length. - * @deprecated 1.2.7 Use polestar_excerpt() - */ -function polestar_excerpt_length( $length ) { - return get_theme_mod( 'excerpt_length', 55 ); -} -add_filter( 'excerpt_length', 'polestar_excerpt_length', 10 ); -endif; - if ( ! function_exists( 'polestar_excerpt_more' ) ) : /** * Add a more link to the excerpt. @@ -30,4 +19,3 @@ function polestar_excerpt_more( $more ) { } } endif; -add_filter( 'excerpt_more', 'polestar_excerpt_more' ); diff --git a/inc/template-tags.php b/inc/template-tags.php index 747bc21..4b65a13 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -65,8 +65,12 @@ function polestar_breadcrumbs() { * Display the WooCommerce mini cart. */ function polestar_mini_cart() { - if ( class_exists( 'Woocommerce' ) && ! ( is_cart() || is_checkout() ) ) : ?> - + if ( + class_exists( 'Woocommerce' ) && + apply_filters( 'polestar_display_mini_cart', ! ( is_cart() || is_checkout() ) ) + ) : + global $woocommerce; + ?>
' . implode( " ", $excerpt ) . $ellipsis . '
' . $read_more_text; - } else { - $excerpt = '' . implode( " ", $excerpt ) . $ellipsis . '
'; - } - } else { - $excerpt = get_the_excerpt(); - } - $excerpt = preg_replace( '`\[[^\]]*\]`','', $excerpt ); + $length = ! empty( get_theme_mod( 'excerpt_length' ) ) ? get_theme_mod( 'excerpt_length' ) : 55; + $excerpt = get_the_excerpt(); + $excerpt_add_read_more = str_word_count( $excerpt ) >= $length; + + if ( ! has_excerpt() ) { + $excerpt = '' . wp_trim_words( $excerpt, $length, '...' ) . '
'; + } - echo $excerpt; + if ( ! empty( $read_more_text ) && ( has_excerpt() || $excerpt_add_read_more ) ) { + $excerpt = '' . $excerpt . '
' . '' . $read_more_text . '
'; + } + echo wp_kses_post( $excerpt ); } endif; diff --git a/js/jquery.theme.js b/js/jquery.theme.js index a902266..eb3a4c0 100644 --- a/js/jquery.theme.js +++ b/js/jquery.theme.js @@ -105,7 +105,7 @@ } ); // Main menu. - $( window ).load( function() { + $( window ).on( 'load', function() { $( 'body.no-js' ).removeClass( 'no-js' ); if ( $( 'body' ).hasClass( 'css3-animations' ) ) { diff --git a/readme.txt b/readme.txt index b57f57a..afd51a7 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: Puro Tags: one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-menu, custom-logo, featured-images, footer-widgets, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready, blog, e-commerce -Tested up to: 5.6 +Tested up to: 5.7 Requires at least: 4.7 Requires PHP: 5.6.20 License: GPLv2 or later @@ -152,7 +152,17 @@ Released under [GPL version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0 == Changelog == -= 1.5.0 - 04 February 2020 = += 1.6.0 - 27 May 2021 = +* Updated logo lazy loading exclusion function. +* Updated featured image lazy load function. +* Minor adjustment to search results spacing. +* Improved the custom excerpt function. +* Added FitVids to the Block Editor. +* Updated Customizer Library. +* Developer: Added WooCommerce `polestar_display_mini_cart` filter to allow the mini-cart to be hidden when empty. +* Developer: Updated a theme JS function for jQuery 3.5 that was previously overlooked. + += 1.5.0 - 04 February 2021 = * Added RankMath breadcrumb support. * WooCommerce: Linked mini-cart View Cart hover color setting to `Accent Color`. * WooCommerce: Improved Quick View gallery variation support. diff --git a/sass/site/primary/_posts-and-pages.scss b/sass/site/primary/_posts-and-pages.scss index 8b725b6..d98185c 100644 --- a/sass/site/primary/_posts-and-pages.scss +++ b/sass/site/primary/_posts-and-pages.scss @@ -307,7 +307,7 @@ article { border-bottom: 1px solid $color__background-hr; margin: 0 0 50px; - padding: 0 0 30px; + padding: 0 0 50px; &:last-of-type { border: 0; diff --git a/sass/style.scss b/sass/style.scss index ae8bbc9..223e388 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -5,7 +5,7 @@ Author URI: https://purothemes.com/ Theme URI: https://purothemes.com/themes/polestar/ Description: Lead the way with Polestar. It's fast loading, responsive, lightweight and flexible design is perfectly suited for building dynamic pages with SiteOrigin's Page Builder and selling with WooCommerce. Ecommerce features include a menu mini-cart and product quick-view. Polestar features a sticky header, beautiful header search, scroll to top and just the right amount of Customizer theme settings. Page level settings let you adjust the theme layout on a page by page basis, perfect for landing pages. If you run a blog, Polestar is ready with awesome features including a full-width posts slider integrated with Jetpack Featured Content, an author box and related posts section. For assistance, check out our theme documentation (http://purothemes.com/documentation/) or ask a question on our support forum (https://purothemes.com/support/). Version: dev -Tested up to: 5.6 +Tested up to: 5.7 Requires at least: 4.7 Requires PHP: 5.6.20 License: GNU General Public License v2 or later diff --git a/style.css b/style.css index 434b611..dd3631b 100644 --- a/style.css +++ b/style.css @@ -5,7 +5,7 @@ Author URI: https://purothemes.com/ Theme URI: https://purothemes.com/themes/polestar/ Description: Lead the way with Polestar. It's fast loading, responsive, lightweight and flexible design is perfectly suited for building dynamic pages with SiteOrigin's Page Builder and selling with WooCommerce. Ecommerce features include a menu mini-cart and product quick-view. Polestar features a sticky header, beautiful header search, scroll to top and just the right amount of Customizer theme settings. Page level settings let you adjust the theme layout on a page by page basis, perfect for landing pages. If you run a blog, Polestar is ready with awesome features including a full-width posts slider integrated with Jetpack Featured Content, an author box and related posts section. For assistance, check out our theme documentation (http://purothemes.com/documentation/) or ask a question on our support forum (https://purothemes.com/support/). Version: dev -Tested up to: 5.6 +Tested up to: 5.7 Requires at least: 4.7 Requires PHP: 5.6.20 License: GNU General Public License v2 or later @@ -2098,7 +2098,7 @@ a { .search-results article { border-bottom: 1px solid #e6e6e6; margin: 0 0 50px; - padding: 0 0 30px; } + padding: 0 0 50px; } .search-results article:last-of-type { border: 0; } .search-results article:only-of-type {