Tell us what you are trying to do? I'm trying to build an Event site.
In the post I have created two date fields, one for the start and one for the end of the event.
So what I need to do is: If the today date is < of the start date the system will show that "the Event will be" message. If today date is >= of the start date and is < of the end date the system will show that "the Event now is coming" message. If today date is >= of the end date the system will show that "the Event is ended" message.
Now, what should I do to have the today date?
And is it correct to use this logic system or there are other methods to do that?
Is there any documentation that you are following? No
Is there a similar example that we can see? I don't know
Thank you.
So, now I'm using the code you have written before, but it doesn't work fine... The conditional logic show always the message that the event is ended...
Secondly i've updated the shortcode to convert your datefield to a timestamp. This update means that you won't need to pass the entire date field shortcode as a parameter but only the actual slug of the field without the wpcf- prefix.
[wpv-conditional if="( '[wp_get_today]' lte '[wp_date_totimestamp date_field="datetime"]' ) "] Test [/wpv-conditional]
So this checks to see if Todays date is less than or equal to the date time in my field and Displays TEST as long as the condition remains true.
Finally in order to get these shortcodes to work in our conditionals they must be added to the Toolset 3rd party shortcode arguments in Toolset -> Settings -> Frontend .
Hi, thank you very much.
So, I have used your code changing "wp_date" with "data-oggi", I have deleted the wpcf- prefix in the datetime field in the shortcode, but all condition I use return me the message that the event is gone...
The view below is listing out from the Comuni CPT, so the field in the view will naturally want to get the date field for that CPT. However there is no date field there. The datefield is actually on the default wordpress Post type.
I checked to see how they are related but there is no post relationship between the two.
Ok, I can do change to the View, but, if you see the attached image, I have used the conditional logic with the datetime shortcode in a module outside the View.
You can test on it
So, I have replaced the code into the custom code section and I think that the multiple time looping is solved.
Can you test it?
But the conditional logic doesn't work fine