Php 将修改后的时间添加到wordpress中的内容

Php 将修改后的时间添加到wordpress中的内容,php,wordpress,Php,Wordpress,我想显示我在wordpress博客上修改文章的时间。 我试图找到代码,这里是我找到的 function wpb_last_updated_date( $content ) { $u_time = get_the_time('U'); $u_modified_time = get_the_modified_time('U'); if ($u_modified_time >= $u_time + 86400) { $updated_date = get_the_modified_time

我想显示我在wordpress博客上修改文章的时间。 我试图找到代码,这里是我找到的

function wpb_last_updated_date( $content ) {
$u_time = get_the_time('U'); 
$u_modified_time = get_the_modified_time('U'); 
if ($u_modified_time >= $u_time + 86400) { 
$updated_date = get_the_modified_time('F jS, Y');
$updated_time = get_the_modified_time('h:i a'); 
$custom_content .= '<p class="last-updated">Updated on'. $updated_date . ' at '. $updated_time .'</p>';  
} 

$custom_content .= $content;
return $custom_content;
}
add_filter( 'the_content', 'wpb_last_updated_date' );
但我真的不知道如何将它应用到我的主题中,显示我的主题发布时间的代码如下所示

<?php if( ! empty( $mts_options["mts_{$section}_headline_meta_info"]['date']) ) { ?>
<span class="thetime updated"><i class="fa fa-clock-o"></i> Published on <span itemprop="datePublished"><?php the_time( get_option( 'date_format' ) ); ?></span></span>
<?php } ?>
我把代码修改成这个

<?php if( ! empty( $mts_options["mts_{$section}_headline_meta_info"]['date']) ) { ?>
<span class="thetime updated"><i class="fa fa-clock-o"></i> Published on <span itemprop="datePublished"><?php the_time( get_option( 'date_format' ) ); ?></span> Updated on <span itemprop="dateModified"><?php get_the_time( get_option( 'date_format' ) ); ?></span></span>
<?php } ?>

我是php新手,有人能帮忙吗?顺便说一句,我正在使用mythemeshop的约塞米蒂主题,你不需要第一组代码过滤器挂钩

按如下方式打印修改后的时间:修改后的时间获取选项“日期格式”