Title: Date based conditional function
Last modified: August 19, 2016

---

# Date based conditional function

 *  [mattloak](https://wordpress.org/support/users/mattloak/)
 * (@mattloak)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/date-based-conditional-function/)
 * How would I write a function that applies some change only to posts published
   after a particular date?
 * For example, one thing I’d like to do is to have my theme automatically insert
   the “Featured Image” at the beginning of each post but I only want this to apply
   to every post moving forward because all of my posts prior to this have the image
   manually inserted at the beginning of the post and without a conditional exception
   I would either have thousands of posts with two leading images or have to remove
   thousands of images manually.
 * The function would go something like this:
 * “If the post was published after 9/3/2010 then display the featured image, or
   else do nothing”
 * How would I write that?

The topic ‘Date based conditional function’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [mattloak](https://wordpress.org/support/users/mattloak/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/date-based-conditional-function/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
