Skip to content

Commit 324dbcb

Browse files
Merge pull request #98 from OpenSourceOrg/merge/blog-post-date
Merge/blog post date
2 parents 09f69df + d2ac400 commit 324dbcb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

themes/osi/inc/template-tags.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010
if ( ! function_exists( 'osi_posted_on' ) ) :
1111
/**
1212
* Prints HTML with meta information for the current post-date/time and author.
13+
*
14+
* @param string $format Date format.
1315
*/
1416
function osi_posted_on( $format = '' ) {
1517

1618
$time_string = '<time class="byline--date entry-date published" datetime="%1$s">%2$s</time>';
17-
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
18-
$time_string = '<time class="byline--date entry-date published updated" datetime="%3$s">%4$s</time>';
19+
20+
// Don't display the updated date for blog posts.
21+
if ( 'post' !== get_post_type() ) {
22+
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
23+
$time_string .= '<time class="byline--date entry-date published updated" datetime="%3$s">%4$s</time>';
24+
}
1925
}
2026

2127
$time_string = sprintf(
@@ -32,7 +38,6 @@ function osi_posted_on( $format = '' ) {
3238
);
3339

3440
echo '<span class="posted-on">' . $posted_on . '</span>'; // phpcs:ignore
35-
3641
}
3742
endif;
3843

0 commit comments

Comments
 (0)