File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010if ( ! 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 }
3742endif ;
3843
You can’t perform that action at this time.
0 commit comments