From 6fe9a9e7862fd7fa83aa616cb83c84909a871ee3 Mon Sep 17 00:00:00 2001 From: Igor Telmenko Date: Fri, 2 Apr 2021 09:36:56 +0300 Subject: [PATCH 1/3] Support for More Block - --- .gitignore | 3 ++- assets/css/customizer.css | 7 +++++- assets/js/customizer-controls.js | 12 ++++++++- inc/customizer/default-options.php | 1 + inc/customizer/sections/customizer-blog.php | 28 ++++++++++++++++++++- inc/extras.php | 2 +- template-parts/content.php | 10 ++++++-- 7 files changed, 56 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 40b878d..78f2710 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules/ \ No newline at end of file +node_modules/ +.idea/ diff --git a/assets/css/customizer.css b/assets/css/customizer.css index 3fee35f..b30718d 100644 --- a/assets/css/customizer.css +++ b/assets/css/customizer.css @@ -20,8 +20,8 @@ #customize-control-maxwell_theme_options-blog_description, #customize-control-maxwell_theme_options-post_layout, -#customize-control-maxwell_theme_options-excerpt_length, #customize-control-maxwell_theme_options-read_more_text, +#customize-control-maxwell_theme_options-blog_excerpt_settings_title, #customize-control-maxwell_theme_options-blog_magazine_widgets_title, #customize-control-maxwell_theme_options-single_post_headline, #customize-control-maxwell_theme_options-featured_images, @@ -31,8 +31,13 @@ margin-top: 16px; } +#customize-control-maxwell_theme_options-excerpt_length { + margin-top: 0; +} + #customize-control-maxwell_theme_options-retina_logo_title, #customize-control-maxwell_theme_options-postmeta_headline, +#customize-control-maxwell_theme_options-blog_excerpt_settings_title, #customize-control-maxwell_theme_options-blog_magazine_widgets_title, #customize-control-maxwell_theme_options-single_post_headline, #customize-control-maxwell_theme_options-featured_images, diff --git a/assets/js/customizer-controls.js b/assets/js/customizer-controls.js index 53f24a1..6c8bf16 100644 --- a/assets/js/customizer-controls.js +++ b/assets/js/customizer-controls.js @@ -10,7 +10,7 @@ // Based on https://make.xwp.co/2016/07/24/dependently-contextual-customizer-controls/ wp.customize( 'custom_logo', function( setting ) { - setting.bind( function( value ) { + setting.bind( function( value ) { if ( '' !== value ) { // Set retina logo option to false when a new logo image is uploaded. wp.customize.instance( 'maxwell_theme_options[retina_logo]' ).set( false ); @@ -33,4 +33,14 @@ wp.customize.control( 'maxwell_theme_options[retina_logo]', setupControl ); } ); + // Excerpt Settings + wp.customize( 'maxwell_theme_options[excerpt_use_more_tag]', function( value ) { + const excerptUseMoreTagCallback = function( newVal ) { + const excerptLengthControls = $('#customize-control-maxwell_theme_options-excerpt_length'); + true === newVal ? excerptLengthControls.hide() : excerptLengthControls.show(); + } + excerptUseMoreTagCallback(value.get()); + value.bind( excerptUseMoreTagCallback ); + }); + })( this.wp, jQuery ); diff --git a/inc/customizer/default-options.php b/inc/customizer/default-options.php index 8f0a012..0521f8a 100644 --- a/inc/customizer/default-options.php +++ b/inc/customizer/default-options.php @@ -60,6 +60,7 @@ function maxwell_default_options() { 'post_layout' => 'one-column', 'read_more_text' => esc_html__( 'Continue reading', 'maxwell' ), 'blog_magazine_widgets' => true, + 'excerpt_use_more_tag' => false, 'excerpt_length' => 20, 'meta_date' => true, 'meta_author' => true, diff --git a/inc/customizer/sections/customizer-blog.php b/inc/customizer/sections/customizer-blog.php index 8650d9d..9d50241 100644 --- a/inc/customizer/sections/customizer-blog.php +++ b/inc/customizer/sections/customizer-blog.php @@ -67,7 +67,7 @@ function maxwell_customize_register_blog_settings( $wp_customize ) { // Add Blog Layout setting and control. $wp_customize->add_setting( 'maxwell_theme_options[post_layout]', array( - 'default' => 'three-columns', + 'default' => 'one-column', 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'maxwell_sanitize_select', @@ -86,6 +86,32 @@ function maxwell_customize_register_blog_settings( $wp_customize ) { ), ) ); + // Add Excerpt Settings Headline. + $wp_customize->add_control( new Maxwell_Customize_Header_Control( + $wp_customize, 'maxwell_theme_options[blog_excerpt_settings_title]', array( + 'label' => esc_html__( 'Excerpt Settings', 'maxwell' ), + 'section' => 'maxwell_section_blog', + 'settings' => array(), + 'priority' => 32, + ) + ) ); + + // Add Setting and Control for support for More Block. + $wp_customize->add_setting( 'maxwell_theme_options[excerpt_use_more_tag]', array( + 'default' => false, + 'type' => 'option', + 'transport' => 'refresh', + 'sanitize_callback' => 'maxwell_sanitize_checkbox', + ) ); + + $wp_customize->add_control( 'maxwell_theme_options[excerpt_use_more_tag]', array( + 'label' => esc_html__( 'Excerpt based on More Block', 'maxwell' ), + 'section' => 'maxwell_section_blog', + 'settings' => 'maxwell_theme_options[excerpt_use_more_tag]', + 'type' => 'checkbox', + 'priority' => 35, + ) ); + // Add Excerpt Length setting and control. $wp_customize->add_setting( 'maxwell_theme_options[excerpt_length]', array( 'default' => 20, diff --git a/inc/extras.php b/inc/extras.php index a558c5a..6a5954e 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -170,7 +170,7 @@ function maxwell_excerpt_length( $length ) { * @return string */ function maxwell_excerpt_more( $more_text ) { - return ''; + return ' ...'; } add_filter( 'excerpt_more', 'maxwell_excerpt_more' ); diff --git a/template-parts/content.php b/template-parts/content.php index 5cf8e8a..a30e89b 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -22,8 +22,14 @@
- - +
From f60af819b418ba25189db2617198a9c3d09a532d Mon Sep 17 00:00:00 2001 From: Igor Telmenko Date: Mon, 14 Mar 2022 22:00:45 +0300 Subject: [PATCH 2/3] Theme Name and Description was updated --- style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/style.css b/style.css index a93a3f3..9c976df 100644 --- a/style.css +++ b/style.css @@ -1,9 +1,9 @@ /* -Theme Name: Maxwell -Theme URI: https://themezee.com/themes/maxwell/ +Theme Name: MaxwellFixes +Theme URI: https://github.com/itelmenko/maxwell/tree/master Author: ThemeZee Author URI: https://themezee.com -Description: Maxwell is a minimalistic and elegant WordPress theme featuring an ultra clean magazine layout. With a beautiful typography, various post layouts and a gorgeous featured posts slideshow Maxwell truly helps you to stand out. +Description: Maxwell Theme from https://themezee.com/themes/maxwell/ with fixes. Unfortunately, my PR was declined. For example, it has fix for "more" tag. In admin part you can define behaviour of "Excerpt" (Theme Options -> Blog Settings -> Excerpt Settings). Version: 2.3.6 Requires at least: 5.2 Tested up to: 5.9 From 60fbd6c838878066b59987f1215479cfc1a9dd6c Mon Sep 17 00:00:00 2001 From: Igor Telmenko Date: Sat, 11 Feb 2023 10:08:06 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=88=D1=80=D0=B8=D1=84=D1=82=D0=BE=D0=B2=20=D0=BD=D0=B0=20Rob?= =?UTF-8?q?oto=20=D0=B8=20Sofia=20Sans=20Semi=20Condensed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/editor-style.css | 2 +- assets/css/editor-styles.css | 18 +++++++++--------- functions.php | 6 +++--- sass/_variables.scss | 4 ++-- style.css | 24 ++++++++++++------------ 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/assets/css/editor-style.css b/assets/css/editor-style.css index be973cc..5884201 100644 --- a/assets/css/editor-style.css +++ b/assets/css/editor-style.css @@ -33,7 +33,7 @@ body { color: #303030; font-size: 18px; font-size: 1.125rem; - font-family: 'Titillium Web', Tahoma, Arial; + font-family: 'Roboto', Tahoma, Arial; line-height: 1.75; } diff --git a/assets/css/editor-styles.css b/assets/css/editor-styles.css index fdb5417..4d6e7e1 100644 --- a/assets/css/editor-styles.css +++ b/assets/css/editor-styles.css @@ -41,10 +41,10 @@ --footer-text-color: #303030; --footer-text-hover-color: rgba(0, 0, 0, 0.5); --footer-border-color: rgba(0, 0, 0, 0.15); - --text-font: "Titillium Web", arial, helvetica, sans-serif; - --title-font: "Amaranth", arial, helvetica, sans-serif; - --navi-font: "Titillium Web", arial, helvetica, sans-serif; - --widget-title-font: "Amaranth", arial, helvetica, sans-serif; + --text-font: "Roboto", arial, helvetica, sans-serif; + --title-font: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; + --navi-font: "Roboto", arial, helvetica, sans-serif; + --widget-title-font: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; --title-font-weight: bold; --navi-font-weight: normal; --widget-title-font-weight: bold; @@ -103,7 +103,7 @@ body.block-editor-page .editor-post-title__block .editor-post-title__input { color: var(--title-color); font-size: 36px; font-size: 2.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--title-font); font-weight: bold; font-weight: var(--title-font-weight); @@ -164,7 +164,7 @@ body.maxwell-page-title-hidden.block-editor-page .edit-post-visual-editor .edit- color: var(--text-color); font-size: 17px; font-size: 1.0625rem; - font-family: "Titillium Web", arial, helvetica, sans-serif; + font-family: "Roboto", arial, helvetica, sans-serif; font-family: var(--text-font); line-height: 1.75; line-height: var(--text-line-height); @@ -321,7 +321,7 @@ body.maxwell-page-title-hidden.block-editor-page .edit-post-visual-editor .edit- display: block; color: #303030; color: var(--text-color); - font-family: "Titillium Web", arial, helvetica, sans-serif; + font-family: "Roboto", arial, helvetica, sans-serif; font-family: var(--text-font); font-size: 16px; font-size: 1rem; @@ -783,7 +783,7 @@ div.wp-block-columns { color: var(--widget-title-color); font-size: 20px; font-size: 1.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--widget-title-font); font-weight: bold; font-weight: var(--widget-title-font-weight); @@ -1077,7 +1077,7 @@ div.wp-block-columns { color: var(--title-color); font-size: 24px; font-size: 1.5rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--title-font); font-weight: bold; font-weight: var(--title-font-weight); diff --git a/functions.php b/functions.php index 99fdee5..8c0d1c8 100644 --- a/functions.php +++ b/functions.php @@ -201,13 +201,13 @@ function maxwell_theme_fonts() { */ function maxwell_get_fonts_url() { $font_families = array( - 'Titillium Web:400,400italic,700,700italic', - 'Amaranth:400,400italic,700,700italic', + 'Roboto:400,400italic,700,700italic', + 'Sofia Sans Semi Condensed:400,400italic,700,700italic', ); $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), - 'subset' => urlencode( 'latin,latin-ext' ), + 'subset' => urlencode( 'latin,cyrillic' ), 'display' => urlencode( 'swap' ), ); diff --git a/sass/_variables.scss b/sass/_variables.scss index ec99352..135bf43 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -72,8 +72,8 @@ $themeColors: ( ); // Theme Fonts -$baseFont: "Titillium Web", arial, helvetica, sans-serif; -$titleFont: "Amaranth", arial, helvetica, sans-serif; +$baseFont: "Roboto", arial, helvetica, sans-serif; +$titleFont: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; $themeFonts: ( --text-font : $baseFont, --title-font : $titleFont, diff --git a/style.css b/style.css index 8f0e5a6..f5c16df 100644 --- a/style.css +++ b/style.css @@ -93,10 +93,10 @@ Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/ --footer-text-color: #303030; --footer-text-hover-color: rgba(0, 0, 0, 0.5); --footer-border-color: rgba(0, 0, 0, 0.15); - --text-font: "Titillium Web", arial, helvetica, sans-serif; - --title-font: "Amaranth", arial, helvetica, sans-serif; - --navi-font: "Titillium Web", arial, helvetica, sans-serif; - --widget-title-font: "Amaranth", arial, helvetica, sans-serif; + --text-font: "Roboto", arial, helvetica, sans-serif; + --title-font: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; + --navi-font: "Roboto", arial, helvetica, sans-serif; + --widget-title-font: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; --title-font-weight: bold; --navi-font-weight: normal; --widget-title-font-weight: bold; @@ -329,7 +329,7 @@ textarea { color: var(--text-color); font-size: 17px; font-size: 1.0625rem; - font-family: "Titillium Web", arial, helvetica, sans-serif; + font-family: "Roboto", arial, helvetica, sans-serif; font-family: var(--text-font); line-height: 1.75; line-height: var(--text-line-height); @@ -847,7 +847,7 @@ textarea { text-decoration: none; font-size: 44px; font-size: 2.75rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--title-font); font-weight: bold; font-weight: var(--title-font-weight); @@ -942,7 +942,7 @@ textarea { list-style: none; font-size: 17px; font-size: 1.0625rem; - font-family: "Titillium Web", arial, helvetica, sans-serif; + font-family: "Roboto", arial, helvetica, sans-serif; font-family: var(--navi-font); font-weight: normal; font-weight: var(--navi-font-weight); @@ -1034,7 +1034,7 @@ textarea { text-decoration: none; font-size: 17px; font-size: 1.0625rem; - font-family: "Titillium Web", arial, helvetica, sans-serif; + font-family: "Roboto", arial, helvetica, sans-serif; font-family: var(--navi-font); font-weight: normal; font-weight: var(--navi-font-weight); @@ -1160,7 +1160,7 @@ textarea { word-wrap: break-word; font-size: 36px; font-size: 2.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--title-font); font-weight: bold; font-weight: var(--title-font-weight); @@ -1453,7 +1453,7 @@ body.date-hidden.author-hidden .content-area .widget-magazine-posts .type-post . word-wrap: break-word; font-size: 20px; font-size: 1.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--widget-title-font); font-weight: bold; font-weight: var(--widget-title-font-weight); @@ -2099,7 +2099,7 @@ div.wp-block-columns { color: var(--widget-title-color); font-size: 20px; font-size: 1.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--widget-title-font); font-weight: bold; font-weight: var(--widget-title-font-weight); @@ -2266,7 +2266,7 @@ div.wp-block-columns { word-wrap: break-word; font-size: 20px; font-size: 1.25rem; - font-family: "Amaranth", arial, helvetica, sans-serif; + font-family: "Sofia Sans Semi Condensed", arial, helvetica, sans-serif; font-family: var(--widget-title-font); font-weight: bold; font-weight: var(--widget-title-font-weight);