• Hi,

    How can I add a date function so that an element displays depending on the day?

    For example every Monday

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jonathan Horowitz

    (@jhorowitz)

    Hi @9to5wd!

    In your theme’s functions.php try adding this:

    function today_is($dayOfWeek) {
    	return date( 'l' ) === $dayOfWeek;
    }

    You can use it like this in the Content Visibility setting:

    today_is( 'Monday' ) for every Monday, or

    today_is( 'Saturday' ) || today_is( 'Sunday' ) for every Saturday or Sunday

    Hello
    I’d like to show the 24 slides in Divi according to current time.
    Like this reference site – https://www.trullorestaurant.com/

    Please let me know, how I can do this by using your plugin?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date Function’ is closed to new replies.