Title: Include only on certain date
Last modified: August 18, 2016

---

# Include only on certain date

 *  [owencjones](https://wordpress.org/support/users/owencjones/)
 * (@owencjones)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/include-only-on-certain-date/)
 * On my single post pages, I want to include an xhtml snippet only if the posted
   year was before 2007.
 * How could I do this? I’ve worked out that I’ll need to use the_date(”,”,”,FALSE)
   but thats about as far as I can get.

Viewing 1 replies (of 1 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 4 months ago](https://wordpress.org/support/topic/include-only-on-certain-date/#post-518404)
 * Try this:
 * `<?php if (get_the_time('Y') < 2007) { ?>
    XHTML SNIPPET GOES HERE <?php } ?>

Viewing 1 replies (of 1 total)

The topic ‘Include only on certain date’ is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [19 years, 4 months ago](https://wordpress.org/support/topic/include-only-on-certain-date/#post-518404)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
