still working on my mountain guides site… i’d like to automatically show activities based on today’s date. For example, between december and april, i want to show winter activities repeater on my homepage. And between may and october, i want to show summer activities.
So, i’ve built to similar repeaters on the homepage, one for summer activities and one for winter activities.
Now i’d like to display only one, depending on which day we are when visiting the site.
@StrangeTech i don’t care about the day, i care about the date (and not of the year, i need it to work each year). For example if we are december 1st i want winter activities to display. If we are june 12th, i want to show summer activities
Is it clearer ?
thanks Dan for the solution! i haven’t tested yet coz i had some bad news from client (but it seems like the site will eventually be published next month! Yay!)
when you say add it in your functions, you mean directly in the function.php file ?
I am not sure how this part will work the way you want, as the date of the mid-May will be the same year, not next year, which means it falls BEFORE November… I was under the impression you wanted to catch from the current November, to the next May.
yeah, but current may must be here too, and and if the code displays “between current november and next may” what happens for “current january” ? see what i mean ? coz next year we will be the next current year (no, my brain is not twisted at all!)
I see now what you are doing - the current date is always going to be in the current year and you are using an OR condition to cover the rest of the year - makes perfect sense.