I want to dynamically show the opening hours of today’s weekday.
I’ve created a CPT ‘Traders’ for which I want to have an ACF-field with its opening hours throughout the week. What I then want is only show the opening hours of that weekday, that if wanted folds out into the full opening hours.
There are several ways you can do this. Here are a couple of ideas:
Using individual fields
A possible solution is to create a separate field for each weekday that is a simple text input field for the time period.
You can then load each weekday’s times into individual blocks inside the page/template and then use date based visibility conditions to show/hide them.
Using a repeater
Another possible solution is to use a repeater field containing a weekday selection field and a start time and end time field.
This would require adding some custom code to show/hide the correct weekdays because currently Cwicly doesn’t allow loading of selected repeater items: