Home › Forums › Calendar Products › Events Calendar PRO › How to change Widget List View to show events by days of the current week?
- This topic has 6 replies, 2 voices, and was last updated 8 years, 11 months ago by Barry.
-
AuthorPosts
-
May 20, 2015 at 12:54 am #963785OrlandoParticipant
Hi Guys, I am currently trying to customise the list-widget.php (don’t worry its in my theme folder!)
to look like this the layout below,- Monday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Tuesday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Wednesday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Thursday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Friday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Saturday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
- Sunday
- Event Title – 1pm – 3pm
- Event Title – 4pm – 5:30pm
- Event Title – 6pm – 8pm
Here is a manual example of what I have done…
So far I have been able to change the code to do this
<h5 class="entry-title summary"> <a href="<?php echo esc_url( tribe_get_event_link() ); ?>" rel="bookmark"><?php the_title(); ?></a>, <span class="event-duration"> <?php echo tribe_get_start_time(); ?> - <?php echo tribe_get_end_time(); ?> </span> </h5>
But I need it to loop through each day of the week, and produce it in the format above, and this I am little stumped on.
Thanks for any tips of possible!
May 20, 2015 at 1:18 pm #963985BarryMemberHi Orlando,
What if you do something like this:
- For the first event, figure out which day it’s taking place on and print the “header” for that day
- For each subsequent iteration, and check to see what the day is and if it has changed, print a fresh “header”
- Continue until the loop is done
In terms of actually figuring out if the day has changed, you could do something like this:
tribe_get_start_date( null, false, 'Y-m-d' )
That would provide you with the current event’s start date and you could compare it to that of the preceding event and print out the day header or not, as appropriate.
May 20, 2015 at 3:42 pm #964043OrlandoParticipantThanks I will give this a go…
May 21, 2015 at 6:00 am #964141BarryMemberGood luck!
May 21, 2015 at 6:06 am #964143OrlandoParticipantLOL! im gonna need it!!
May 22, 2015 at 1:31 am #964392BarryMember🙂
June 5, 2015 at 7:06 am #967397BarryMemberHi!
It’s been a while so I’m going to go ahead and close this topic.
- Need help with anything else? Go right ahead and post a new topic, one of the team will be only too happy to help
- Still need help with this issue and need to re-open it? Again, please simply create a new topic and link to this one to provide the team with some context
Thanks!
-
AuthorPosts
- The topic ‘How to change Widget List View to show events by days of the current week?’ is closed to new replies.