Title: Header by date?
Last modified: August 18, 2016

---

# Header by date?

 *  Resolved [sluggo](https://wordpress.org/support/users/sluggo/)
 * (@sluggo)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/header-by-date/)
 * My blog’s main headers are by date. I’m just using a basic loop:
 * `<?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?> <h1
   ><?php the_time('F j, Y') ?></h1> <h2><?php the_title(); ?></h2> <?php the_content();?
   > <?php endwhile; ?> <?php endif; ?>
 * This works fine for me except that if there’s more than one post on the same 
   day, that `<h1>` repeats. How can I get it to only show the date `<h1>` once 
   for a day (before the first post?

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

 *  [charle97](https://wordpress.org/support/users/charle97/)
 * (@charle97)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/header-by-date/#post-392308)
 * use the_date instead of the_time.
 * `<h1><?php the_date('F j, Y') ?></h1>`
 *  Thread Starter [sluggo](https://wordpress.org/support/users/sluggo/)
 * (@sluggo)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/header-by-date/#post-392312)
 * Thanks!

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

The topic ‘Header by date?’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 2 replies
 * 2 participants
 * Last reply from: [sluggo](https://wordpress.org/support/users/sluggo/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/header-by-date/#post-392312)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
