From ee9e857eb31a10337c2b127cb87bf4ac0e8e8d0d Mon Sep 17 00:00:00 2001 From: Nick Green Date: Wed, 24 Jan 2024 14:05:18 -0800 Subject: [PATCH 1/3] Update auto-generated readmore to match blog site --- themes/osi/functions.php | 9 ++++++--- themes/osi/inc/config.php | 5 ----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/themes/osi/functions.php b/themes/osi/functions.php index fbfb3db..8fc6a60 100755 --- a/themes/osi/functions.php +++ b/themes/osi/functions.php @@ -332,10 +332,13 @@ function register_footer_above_sidebar() { } add_action( 'widgets_init', 'register_footer_above_sidebar' ); -// these two functions adjust the 'news' (post archive) to show 1 fewer posts on the first page, for symmetry +/** + * Adjust the 'news' (post archive) to show 1 fewer posts on the first page, for symmetry + */ + add_action( 'pre_get_posts', 'osi_query_offset', 1 ); function osi_query_offset( &$query ) { - if ( ! ( $query->is_blog() || is_main_query() ) ) { + if ( ! ( $query->is_blog() || is_main_query() ) || is_admin() ) { return; } @@ -356,7 +359,7 @@ function osi_query_offset( &$query ) { add_filter( 'found_posts', 'osi_adjust_offset_pagination', 1, 2 ); function osi_adjust_offset_pagination( $found_posts, $query ) { $offset = -1; - if ( $query->is_blog() && is_main_query() ) { + if ( $query->is_blog() && is_main_query() && ! is_admin() ) { return $found_posts - $offset; } return $found_posts; diff --git a/themes/osi/inc/config.php b/themes/osi/inc/config.php index 9eb7b2b..ffaea9a 100644 --- a/themes/osi/inc/config.php +++ b/themes/osi/inc/config.php @@ -78,12 +78,7 @@ function osi_excerpt_length( $length ) { } function osi_excerpt_more( $more ) { - - if ( is_post_type_archive( sugar_calendar_get_event_post_type_id() ) ) { return '...'; - } - - return '... ' . __( 'Read More', 'osi' ) . ''; } add_filter( 'excerpt_length', 'osi_excerpt_length' ); add_filter( 'excerpt_more', 'osi_excerpt_more' ); From 0669ed18af951b110bd1b33019d92c7790339038 Mon Sep 17 00:00:00 2001 From: Nick Green Date: Wed, 31 Jan 2024 16:19:23 -0800 Subject: [PATCH 2/3] Remove featured image from 'posts' --- themes/osi/assets/scss/_6_components.content.scss | 2 +- themes/osi/style.css | 2 +- themes/osi/template-parts/header-featured-image.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/osi/assets/scss/_6_components.content.scss b/themes/osi/assets/scss/_6_components.content.scss index 28dafb8..4097683 100755 --- a/themes/osi/assets/scss/_6_components.content.scss +++ b/themes/osi/assets/scss/_6_components.content.scss @@ -35,7 +35,7 @@ p, h1, h2, h3, h4, h5, h6, blockquote, ol, ul, dl, address { .single-post .cover--header { &.no-thumbnail { - min-height: 430px; + min-height: 305px; } } diff --git a/themes/osi/style.css b/themes/osi/style.css index 8b2752c..acc3357 100755 --- a/themes/osi/style.css +++ b/themes/osi/style.css @@ -3126,7 +3126,7 @@ article.archive { } .single-post .cover--header.no-thumbnail { - min-height: 430px; + min-height: 305px; } .pill-taxonomy ul { diff --git a/themes/osi/template-parts/header-featured-image.php b/themes/osi/template-parts/header-featured-image.php index 7af05ee..e4df74f 100644 --- a/themes/osi/template-parts/header-featured-image.php +++ b/themes/osi/template-parts/header-featured-image.php @@ -15,7 +15,7 @@ ?> - +
@@ -25,9 +25,9 @@
-
+
- ' . esc_html( $page_title ) . '' : ''; ?> + ' . esc_html( $page_title ) . '' : ''; ?>
From c8220deaa9b85fddff08beae1aa50dfc9a2e40a9 Mon Sep 17 00:00:00 2001 From: Nick Green Date: Thu, 1 Feb 2024 12:38:34 -0800 Subject: [PATCH 3/3] Restore comments section & email signup block --- themes/osi/single.php | 2 +- themes/osi/template-parts/content.php | 2 +- themes/osi/template-parts/email-block.php | 4 ++-- themes/osi/template-parts/header-featured-image.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/osi/single.php b/themes/osi/single.php index 7b45bf8..3862ac0 100755 --- a/themes/osi/single.php +++ b/themes/osi/single.php @@ -22,7 +22,7 @@ get_template_part( 'template-parts/content', get_post_type() ); //If comments are open or we have at least one comment, load up the comment template. - if ( 'board-member' === get_post_type() ) : + if ( 'board-member' === get_post_type() || 'post' === get_post_type() ) : if ( comments_open() || get_comments_number() ) : comments_template(); endif; diff --git a/themes/osi/template-parts/content.php b/themes/osi/template-parts/content.php index eff7b40..2b0afc9 100755 --- a/themes/osi/template-parts/content.php +++ b/themes/osi/template-parts/content.php @@ -27,7 +27,7 @@
diff --git a/themes/osi/template-parts/email-block.php b/themes/osi/template-parts/email-block.php index 5ca25b7..4fb574d 100644 --- a/themes/osi/template-parts/email-block.php +++ b/themes/osi/template-parts/email-block.php @@ -1,6 +1,6 @@ post_content ); } \ No newline at end of file diff --git a/themes/osi/template-parts/header-featured-image.php b/themes/osi/template-parts/header-featured-image.php index e4df74f..a739acd 100644 --- a/themes/osi/template-parts/header-featured-image.php +++ b/themes/osi/template-parts/header-featured-image.php @@ -25,7 +25,7 @@
-
+
' . esc_html( $page_title ) . '' : ''; ?>