From ee5d72d650290c4e3363434f7d0deeda89d06f68 Mon Sep 17 00:00:00 2001 From: Geoff Date: Mon, 17 Jun 2024 16:04:17 -1000 Subject: [PATCH 1/2] Don't display the updated date for blog posts but published date --- themes/osi/inc/template-tags.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index ad396e7..533f1f4 100755 --- a/themes/osi/inc/template-tags.php +++ b/themes/osi/inc/template-tags.php @@ -14,8 +14,12 @@ function osi_posted_on( $format = '' ) { $time_string = ''; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = ''; + + // Don't display the updated date for blog posts. + if ( 'post' !== get_post_type() ) { + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string .= ''; + } } $time_string = sprintf( From c3d4987afe6dd27df311855ce29598054697db67 Mon Sep 17 00:00:00 2001 From: Geoff Date: Mon, 17 Jun 2024 16:11:46 -1000 Subject: [PATCH 2/2] Linting fix --- themes/osi/inc/template-tags.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/osi/inc/template-tags.php b/themes/osi/inc/template-tags.php index 533f1f4..6b07ce5 100755 --- a/themes/osi/inc/template-tags.php +++ b/themes/osi/inc/template-tags.php @@ -10,11 +10,13 @@ if ( ! function_exists( 'osi_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. + * + * @param string $format Date format. */ function osi_posted_on( $format = '' ) { $time_string = ''; - + // Don't display the updated date for blog posts. if ( 'post' !== get_post_type() ) { if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { @@ -36,7 +38,6 @@ function osi_posted_on( $format = '' ) { ); echo '' . $posted_on . ''; // phpcs:ignore - } endif;