Title: Adding date
Last modified: August 21, 2016

---

# Adding date

 *  Resolved [sandropel](https://wordpress.org/support/users/sandropel/)
 * (@sandropel)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-date/)
 * Hi. How can I display the date of the post in the sidebar, next to each post?
 * Thanks a lot
 * [http://wordpress.org/extend/plugins/flexible-posts-widget/](http://wordpress.org/extend/plugins/flexible-posts-widget/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [sandropel](https://wordpress.org/support/users/sandropel/)
 * (@sandropel)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-date/#post-3894922)
 * I’ve created a new template following the instructions, and I’ve added the line
   <?php the_date(); ?>
 * Unfortunately, the date is shown only at the first post displayed…
 * Can you help me please?
 * Thanks
 *  [DarrenParlett](https://wordpress.org/support/users/darrenparlett/)
 * (@darrenparlett)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-date/#post-3895079)
 * Hi Sandropel,
 * You have probably sorted this by now but just in case;
 * It sounds like you have added the line in the wrong place e.g. before the _while_
   loop, so the date is only showing once.
 * Cheers
    Darren
 *  [DarrenParlett](https://wordpress.org/support/users/darrenparlett/)
 * (@darrenparlett)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-date/#post-3895080)
 * Or it could be that your posts were published on the same day in which case the`
   the_date()` will only show the date for the first post.
 * In that case try `get_the_date()`
 * Darren
 *  Plugin Author [DaveE](https://wordpress.org/support/users/dpe415/)
 * (@dpe415)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/adding-date/#post-3895152)
 * Hi sandropel,
 * I think [@darrenparlett](https://wordpress.org/support/users/darrenparlett/) 
   was correct in his response (see above). Let me know if this still isn’t working
   for you.
 * basically, in your custom template file, You’d want to add the date after the
   post title like this:
 *     ```
       <h4 class="title"><?php the_title(); ?></h4>
       <span><?php the_date(); ?></span>
       </a>
       ```
   
 * Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding date’ is closed to new replies.

 * ![](https://ps.w.org/flexible-posts-widget/assets/icon-256x256.jpg?rev=984592)
 * [Flexible Posts Widget](https://wordpress.org/plugins/flexible-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [DaveE](https://wordpress.org/support/users/dpe415/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/adding-date/#post-3895152)
 * Status: resolved