Changing ‘last updated’ to original post date
-
Hi,
I recently figured out how to change the default ‘Post last updated’ text to show when the post was originally created. Thought I’d share this with others.
Solution best done with a child theme. This *might* work for people working on other themes, note you would just replace givingpress-lite with your theme name
To change the date on the post itself, go to loop-post.php and find this code
<p><i class="fa fa-clock-o"></i> <?php givingpress_lite_posted_on(); ?></p>
and replace it with
<p><i class="fa fa-clock-o"></i> <?php esc_html_e( 'Posted on', 'givingpress-lite' ); ?> <?php the_time( esc_html__( 'F j, Y', 'givingpress-lite' ) ); ?></p>
Now this will only change it on the post itself, so you need to make similar changes in loop-archive.php, loop-blog.php and loop-category.php to modify the tag, and blog, and category pages.
Now the only issue with this is that it also removes the author name, which you might want to retain. Can anyone figure out how to do that? Edit: see final post for solution!
- The topic ‘Changing ‘last updated’ to original post date’ is closed to new replies.