Hey @franticape,
Why the Condition is Failing
The primary issue is the date format being used for comparison: d M Y (e.g., "07 Jul 2026").
When Pro evaluates conditions like before or after on formatted date strings, it compares them alphabetically/lexicographically rather than chronologically. For example, "10 Jan 2026" might be evaluated as “before” "07 Jul 2026" simply because 1 comes before 0 or J comes before J, which leads to inconsistent and incorrect results.
The Solution
For logical comparisons in conditions, you should always compare dates using either Unix Timestamps or a chronological string format like Ymd (e.g., 20260707).
Option A: Compare using Unix Timestamps (Recommended)
Since your metadata is already stored as a timestamp, compare raw timestamps directly:
-
Today’s Timestamp:
{{global.date({"format":"U"})}} (evaluates to a Unix timestamp like 1783456789)
-
Custom Metadata Timestamp:
{{dc:post:meta key="wpcf-fecha-webinar"}} (no format wrapper needed if it’s already a raw timestamp)
Option B: Compare using chronological format (Y-m-d or Ymd)
If you must use date formats, use:
-
Today:
{{global.date({"format":"Ymd"})}}
-
Custom Metadata:
{{dc:date:generic date="@{{dc:post:meta key="wpcf-fecha-webinar"}}" format="Ymd"}}
How to Debug This in the Future
-
Print the Raw Values: Add a temporary text element inside the looper/layout and paste your two dynamic content strings side-by-side:
Today: {{global.date({"format":"d M Y"})}
Custom: {{dc:date:generic date="@{{dc:post:meta key="wpcf-fecha-webinar"}}" format="d M Y"}}
This lets you inspect exactly what strings the WordPress server is comparing.
-
Check Timezones: Ensure your WordPress timezone settings under Settings > General match your local target timezone. global.date respects the WordPress timezone setting, which can sometimes cause “today” to differ by a day if not configured correctly.