Title: Align postdate and posttitle
Last modified: August 20, 2016

---

# Align postdate and posttitle

 *  [Ceebe](https://wordpress.org/support/users/ceebe/)
 * (@ceebe)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/)
 * Hi,
    On my twentyeleven childtheme I made a datebutton but without the button,
   see: [http://www.knotjebril.nl](http://www.knotjebril.nl) with this code in index.
   php:
 *     ```
       <div class="postdate">
       <div class="postday"><?php the_time('d'); ?></div>
       <div class="postmonth"><?php the_time('F'); ?></div>
       <div class="postyear"><?php the_time('Y'); ?></div>
       </div>
       ```
   
 * Now I want to **align** the date and posttitle, but i can not get it to work.
   Have tried everything with margin, padding, nothing works.
 * Concerning the posttitle I have centered it as follows:
 *     ```
       .entry-title, .entry-title a {
       text-align:center;
       }
       ```
   
 * Anyone any idea how to sort this out?

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

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247251)
 * You probably need to put the postdate div inside the entry-header div:
 *     ```
       <header class="entry-header">
           <div class="postdate">
           <h1 class="entry-title">
       ```
   
 * and then use CSS to fine-tune the position, perhaps useing float: left;.
 *  Thread Starter [Ceebe](https://wordpress.org/support/users/ceebe/)
 * (@ceebe)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247255)
 * Thanks WP yogi, but this doesn’t work; I lost the date completely. It looks like
   this now:
 *     ```
       <header class="entry-header">
       <div class="postdate">
       <div class="postday"><?php the_time('d'); ?></div>
       <div class="postmonth"><?php the_time('F'); ?></div>
       <div class="postyear"><?php the_time('Y'); ?></div>
       </div>
       <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
       </header><!-- .entry-header -->
       ```
   
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247262)
 * Looks the same to me — ?? I don’t see what you posted above.
 *  Thread Starter [Ceebe](https://wordpress.org/support/users/ceebe/)
 * (@ceebe)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247278)
 * I just wanted to make sure I did the right thing.
    Do you have any other suggestions?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247280)
 * You’re not going to be able to align those unless the post date section is inside
   the article div. If you tried that and it stopped showing up, there was likely
   a code problem. If you post the template code **in a pastebin** so someone can
   look at the php code, that might be helpful.
 *  Thread Starter [Ceebe](https://wordpress.org/support/users/ceebe/)
 * (@ceebe)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247282)
 * Okay, thanks yogi, for your reply. Will try that.

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

The topic ‘Align postdate and posttitle’ is closed to new replies.

 * 6 replies
 * 2 participants
 * Last reply from: [Ceebe](https://wordpress.org/support/users/ceebe/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/align-postdate-and-posttitle/#post-3247282)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
