Skip to main content

Show Element on Specific Date of the Week at Specific Time

Updated over 12 months ago

First of all, please, add this code to functions.php of your child theme or in Code Snippets plugin


For example, if we need to show item on Monday from 11:00 to 03:00

we can use such condition: NH >= 111 AND NH < 203 (where N means number of the day and H meand hours, so 111 will be Monday 11:00)

111 and 203 will be our Values and Data Type should be numeric

Let's check another example, when we need to display element on Friday from 11:00 to Sunday 04:00. In this case conditions will be the following: NH >= 511 AND NH < 604

Also, it’s possible to set up condition like this:

For example we need to display item on Sunday from 11am till 2am next morning

In this case, condition will be like this: NH - In the list - 711,712,713,714,715,716,717,718,719,720,721,722,723,100,101

So in this way we simply list all values from 11:00 till 02:00

And if you need to specify time, for example Tuesday 11:16 in this case, instead of NH, you need NHi. And the value will be 21116, where 2 - is number of the day, 11 - hour and 16 - minutes.

If you need to combine two conditions for different days, you need to use condition Between

And set Value like this

Then another condition for another day

And relation between conditions will be OR

Did this answer your question?