From 94234e5038b27bd8240035ad602bb6bbda08b8c5 Mon Sep 17 00:00:00 2001 From: Marcos Rego <43761910+marcosrego-web@users.noreply.github.com> Date: Mon, 17 May 2021 16:41:51 +0100 Subject: [PATCH 1/6] Add option for excerpt Underscores only supports the use of "read more" inside of the content. But I think enough devs would like to have the option of the "classic" excerpt from the start. Also for some clients might be easier to understand/learn the use of an excerpt that is outside of the content. --- template-parts/content.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/template-parts/content.php b/template-parts/content.php index 4f7ee77dd3..a1288182b6 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -33,20 +33,24 @@
"%s"', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - wp_kses_post( get_the_title() ) - ) - ); + if ( has_excerpt() ) : + the_excerpt(); + else : + the_content( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Continue reading "%s"', '_s' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + wp_kses_post( get_the_title() ) + ) + ); + endif; wp_link_pages( array( From 67d9b88c6da4561af180c159d6a8aa14f615ff6c Mon Sep 17 00:00:00 2001 From: Marcos Rego <43761910+marcosrego-web@users.noreply.github.com> Date: Mon, 24 May 2021 23:29:58 +0100 Subject: [PATCH 2/6] Update content.php --- template-parts/content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-parts/content.php b/template-parts/content.php index a1288182b6..ad76f37bee 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -33,7 +33,7 @@
Date: Thu, 27 May 2021 20:39:53 +0100 Subject: [PATCH 3/6] Content thumbnail inside the header Suggestion: For better structure and SEO put the post-thumbnail inside the header tag. --- template-parts/content.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template-parts/content.php b/template-parts/content.php index ad76f37bee..15d83d29d6 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -27,10 +27,10 @@ ?>
+ + - -
Date: Thu, 27 May 2021 20:41:45 +0100 Subject: [PATCH 4/6] Post thumbnail inside the header Suggestion: For better structure and SEO put the post-thumbnail inside the header tag. --- template-parts/content-page.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 3d34fc3467..8d7ac8ed70 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -12,9 +12,10 @@
>
', '' ); ?> +
- +
Date: Thu, 27 May 2021 20:44:18 +0100 Subject: [PATCH 5/6] Post thumbnail inside the header Suggestion: For better structure and SEO put the post-thumbnail inside the header tag. --- template-parts/content-search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template-parts/content-search.php b/template-parts/content-search.php index b25dadf243..f5435073c2 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -21,10 +21,10 @@ ?>
+ + - -
From e364edefd0bd3ca7fe1055531ca075afe98a9554 Mon Sep 17 00:00:00 2001 From: Marcos Rego <43761910+marcosrego-web@users.noreply.github.com> Date: Thu, 10 Jun 2021 18:43:41 +0100 Subject: [PATCH 6/6] Restrict the_post_navigation to same term Most of the times it's not intended to show posts from different categories on the post navigation. --- single.php | 1 + 1 file changed, 1 insertion(+) diff --git a/single.php b/single.php index bd982141df..6ecb2efb0e 100644 --- a/single.php +++ b/single.php @@ -22,6 +22,7 @@ array( 'prev_text' => '' . esc_html__( 'Previous:', '_s' ) . ' %title', 'next_text' => '' . esc_html__( 'Next:', '_s' ) . ' %title', + 'in_same_term' => true, ) );