Hello @stefan57,
if we get you right, you want to show or hide based on a date/time.
You should already be able to do that.
– Dynamic Tag -> Current Date Time
– Show/Hide -> depends on you
– Condition -> Less/Greater then (depends on you)
– Compare Type -> String to time
– Conditional value -> now
Or you can use it with custom dates
– Dynamic Tag -> ACF Date/Time field
– Show/Hide -> depends on you
– Condition -> Less/Greater then (depends on you)
– Compare Type -> String to time
– Conditional value -> today UTC
Or any other string to time value.
Did it solve your suggestion?
Thanks for your quick reply!
I have tested and cannot get it to work.
Say I have 10 different posts in my db, all with a custom field named: coupon_expire_datetime
And all posts have different expiration datetime.
I select coupon_expire_datetime as Dynamic Tag.
I select Greater Than
And then date and that pulls up a calendar where I manually have to set a date.
What I am looking for is to match it against Current Date or Current DateTime.
If coupon_expire_datetime is greater than Current DateTime, then it is visible,
and once coupon_expire_datetime becomes less that Current DateTime, it becomes hidden.
This way I can have my 10 posts show and hide automatically after how I have set the value in the custom field: coupon_expire_datetime
An example how the custom field value can look: “Dec 24, 2020 00:00:00” or “Nov 15, 2019 12:50:00”
Hope I explained good enough so you can understand me 🙂
IF this can be done today already, and I missed something, can you explain the process to me?
Hello @stefan57,
we tried it and got it work.
Steps:
– ACF Field -> Date Picker (reveal-date)
– Use on All posts
– Create 2 Posts
– Post 1 reveal-date = yesterday
– Post 2 reveal-date = tomorrow
– Dynamic Tag -> ACF Field (reveal-date)
– Show/Hide -> Show when condition met
– Condition -> Grater then
– Compare Type -> String to time
– Conditional value -> now
Results (Debug):
Post 1:
Element:section-b0caf4e (section)
DynamicTag-Tag:acf-text
DynamicTag-Key:field_5dbaa3386d7f5:reveal-date
DynamicTag-Value:1572393600
Check-Value:1572513199
Check-Value2:0
Condition-Type:strtotime
Condition:Show if greater
Condition met:no
Post2:
Element:section-b0caf4e (section)
DynamicTag-Tag:acf-text
DynamicTag-Key:field_5dbaa3386d7f5:reveal-date
DynamicTag-Value:1572566400
Check-Value:1572513200
Check-Value2:0
Condition-Type:strtotime
Condition:Show if greater
Condition met:yes
We hope that helps you.
THANK YOU!
It looks like that should do the trick 🙂
Thanks again for Super Support!
/Stefan
Hello @stefan57,
you are welcome. We close the issue. Thank you.