Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Fix post date output #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions wordpress/wp-content/themes/cds-default/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ function cds_posted_on(): void
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
}

$time_string = sprintf(
$time_string,
esc_attr(get_the_date(DATE_W3C)),
esc_html(get_the_date()),
esc_attr(get_the_modified_date(DATE_W3C)),
esc_html(get_the_modified_date())
esc_html(get_the_date())
);

$posted_on = $time_string;
Expand Down