Adding Time Stamp to Twenty Eleven Theme (WordPress)

Okay,  I’m no coder but I do like to tinker and dig around if needed. The Twenty Eleven theme for WordPress has only the date on the Index page and on the post page as below. I searched on Google looking for someone who had done this. I absolutely could not find someone. That is why I am posting this so if anyone else with Twenty-Eleven would like to have the time stamp they can follow this.

indexpage

I wanted the Date and Time to show. First I checked around and found out the php syntax for the Time. Using the Editor in the Admin>Appearance section I located teh two areas below. Then I had to search painstakingly for where to place the code. I located these areas in the two sections.

content.php
Search for “posted_on” (without the quotes) and locate this code section. Add the bold code below including the spaces before and after ” at “.

<?php if ( ‘post’ == get_post_type() ) : ?>
<div class=”entry-meta”>
<?php twentyeleven_posted_on(); ?> at
<?php the_time(); ?>

The next area was content-single.php

Again search for “posted_on” (without the quotes) and locate this code section and again add the bold code including the spaces before and after “at”.

<?php if ( ‘post’ == get_post_type() ) : ?>
<div class=”entry-meta”>
<?php twentyeleven_posted_on (); ?> at
<?php the_time(); ?>
You should now have the Date and Time showing on the index, and when viewing individual posts. I hope this helps someone as I know it was a challenge to find out how to do it on my own.posts

Comments welcome,

 

2 thoughts on “Adding Time Stamp to Twenty Eleven Theme (WordPress)

  1. Yes, it was bothering me that the Time stamp has been lost due to an upgrade to the WorPress theme. I couldn’t remember how I did it last time, so I spent 2 hours scouring the files and Google trying to do it again. Wound up using my method as there wasn’t that much out there that was simple to just plug in. I think I’ll take a break now haha.

Share your thoughts, leave us a comment.