迄今为止:
function ci_posted_on() {
$time_string = \'<time itemprop="datePublished" content="%2$s" class="entry-date published updated" datetime="%1$s">%2$s</time>\';
if ( get_the_time( \'U\' ) !== get_the_modified_time( \'U\' ) ) {
$time_string = \'<time itemprop="datePublished" content="%2$s" class="entry-date published" datetime="%1$s">%2$s</time><time itemprop="dateModified" content="%4$s" class="updated" datetime="%3$s">%4$s</time>\';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( \'c\' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( \'c\' ) ),
esc_html( get_the_modified_date() )
);
$time_posted = esc_html( get_the_time() );
$u_time = get_the_time(\'U\');
$u_modified_time = get_the_modified_time(\'U\');
$posted_on = sprintf(
_x( \'%s\', \'post date\', \'ci\' ),
\'\' . $time_string . \'\'
);
if ($u_modified_time >= $u_time + 86400) :
the_modified_time(\'g:i a\');
else :
echo \' . $posted_on . \' at \' . $time_posted . \';
这是工作,但使用修改日期,我想如果发布日期小于24小时显示时间,并在24小时后显示日期和时间