Title: Inconsistent output from date code
Last modified: August 19, 2017

---

# Inconsistent output from date code

 *  [Evil Overlord](https://wordpress.org/support/users/evil-overlord/)
 * (@evil-overlord)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/inconsistent-output-from-date-code/)
 * I’m trying to put together a very simple formula that alternates content based
   on a date – if it’s before X, it says “story will be published”. If it’s on or
   after, it says “story was published”. I’ve thought I had this done several times,
   only to realize the output isn’t as anticipated. Now, I’m realizing it may not
   be me at all.
 * For example, in two different posts, the same code gives different results.
 * **Code ** (same for both posts)
    “Story” [if field=date before=’2017-08-17′] 
   will be [else] was[/if] published on 17 August 2017. “Story” [if field=date before
   =’2017-08-19′] will be [else] was[/if] published on 19 August 2017. “Story” [
   if field=date before=’2017-08-21′] will be [else] was[/if] published on 21 August
   2017.
 * **Result 1** (draft post that has seen multiple versions, was published once 
   by mistake)
    “Story” was published on 17 August 2017. “Story” was published on
   19 August 2017. “Story” was published on 21 August 2017.
 * **Result 2** (code copied and pasted from above, never published, never saved)
   “
   Story” was published on 17 August 2017. “Story” was published on 19 August 2017.“
   Story” will be published on 21 August 2017.
    -  This topic was modified 8 years, 9 months ago by [Evil Overlord](https://wordpress.org/support/users/evil-overlord/).

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

 *  Thread Starter [Evil Overlord](https://wordpress.org/support/users/evil-overlord/)
 * (@evil-overlord)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/inconsistent-output-from-date-code/#post-9455197)
 * No response?
 *  Thread Starter [Evil Overlord](https://wordpress.org/support/users/evil-overlord/)
 * (@evil-overlord)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/inconsistent-output-from-date-code/#post-9831189)
 * Still nothing? Should I assume that this functionality simply doesn’t … function?
 *  Thread Starter [Evil Overlord](https://wordpress.org/support/users/evil-overlord/)
 * (@evil-overlord)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/inconsistent-output-from-date-code/#post-10393431)
 * Eliot,
 * Good to see you back and answering questions. I wasn’t sure how far back you’d
   go, so I’m bumping this up with a new reply. I’d really love to use this plugin
   for this – haven’t found another solution to the problem.

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

The topic ‘Inconsistent output from date code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

## Tags

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

 * 3 replies
 * 1 participant
 * Last reply from: [Evil Overlord](https://wordpress.org/support/users/evil-overlord/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/inconsistent-output-from-date-code/#post-10393431)
 * Status: not resolved