Title: Error on date expression
Last modified: March 5, 2020

---

# Error on date expression

 *  [axlf81](https://wordpress.org/support/users/axlf81/)
 * (@axlf81)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/error-on-date-expression/)
 * Hey,
 * I tried show a section until a specific date. I entered the following expression
 * `date('Ymd') <= '20200327'`
 * When I now look at my page I see only half of the section and
    `[/et_pb_column]`
   See the [screenshot](https://snipboard.io/4nNfEZ.jpg)
 * If I enter only booleans as expression, it works without error.
 * Am I doing something wrong?
    -  This topic was modified 6 years, 3 months ago by [axlf81](https://wordpress.org/support/users/axlf81/).

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

 *  Plugin Author [Jonathan Horowitz](https://wordpress.org/support/users/jhorowitz/)
 * (@jhorowitz)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/error-on-date-expression/#post-12513796)
 * Hi [@axlf81](https://wordpress.org/support/users/axlf81/)!
 * Sometimes the shortcode parser gets confused with certain expressions.
 * Try defining a function in your theme like this:
 *     ```
       function today_is_before_or_on($date) {
       	return date('Ymd') <= $date;
       }
       ```
   
 * And then call it in the Content Visibility setting: `today_is_before_or_on('20200327')`
 *  Thread Starter [axlf81](https://wordpress.org/support/users/axlf81/)
 * (@axlf81)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/error-on-date-expression/#post-12516174)
 * Hm. Thank you.
 * Is it possible to create functions in a plain divi theme?
 * I’m not using a child theme…

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

The topic ‘Error on date expression’ is closed to new replies.

 * ![](https://ps.w.org/content-visibility-for-divi-builder/assets/icon-256x256.
   png?rev=1359961)
 * [Content Visibility for Divi Builder](https://wordpress.org/plugins/content-visibility-for-divi-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-visibility-for-divi-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [axlf81](https://wordpress.org/support/users/axlf81/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/error-on-date-expression/#post-12516174)
 * Status: not resolved