方法

分别打开single.php  和page.php  两个文件,找到:

<?php the_content(); ?>

在这行代码的上面或者下面添加以下代码:

<?php if ( (int)get_the_modified_time("U") > (int)get_the_time("U") ) : ?>
    <div align="center">
        <font color="#999" size="1" align="center">
            文章最后编辑于:<?php the_modified_time("Y-n-j H:i:s"); ?>
        </font>
    </div>
<?php endif; ?>

由于前端不怎么会,就加了一点简单的属性,而且是直接在标签里面设置的属性,有前端基础的同学可以设置在样式中。

效果

最后修改:2017 年 10 月 08 日
如果觉得我的文章对你有用,请随意赞赏