A way to add AND or OR conditionals?
-
Hey there!
I’m trying to set this up where our website will show whether they’re open or close at the time and each day has a differing schedule. So, for each day there is a shortcode like this:[time-restrict-repeat type=”weekly” onday=”Saturday” offday=”Saturday” ontime=”10:00:00″ offtime=”23:00:00″ else=”Work sucks, drink beer.”]
It’s the weekend baby!
[/time-restrict-repeat][time-restrict-repeat type=”weekly” onday=”Sunday” offday=”Sunday” ontime=”11:00:00″ offtime=”19:00:00″ else=”Work sucks, drink beer.”]
It’s the weekend baby!
[/time-restrict-repeat]ETC….
With this setup, it will always output the “else” content, in this case it will repeat the “Work sucks, drink beer.” statement 6 times (one for each day it is not).Since the “OFF” statement is the same, is there a way only run one “OFF” statement? Or a conditional like so:
IF it’s Saturday AND between X and Y
OR
it’s Sunday between x and y
OR
it’s Monday between x and y
DO THIS
ELSE
DO THIS INSTEADThis way it would only produce one ELSE content.
Thanks!
- The topic ‘A way to add AND or OR conditionals?’ is closed to new replies.