Home › Forums › Calendar Products › Events Calendar PRO › Styling weekly event list where there is no event.
- This topic has 4 replies, 2 voices, and was last updated 11 years, 10 months ago by Jonah.
-
AuthorPosts
-
June 4, 2012 at 10:23 am #20133JeremyMember
Hi guys,
I was wondering if there is a way to set up a style for days when there aren’t events. I’ve tried, both with WP_Query and tribe_get_events (using https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events as an example) to call a day without an event, but only seems to get either
A. the next available event
B. the event that bleeds into said day (almost all events end at 2:00 am the next day)Mondays, there aren’t any recurring events but the client wants to promote the fact that people can host their own events. Example, our current calendar’s event list: http://curelounge.com/upcoming-events/#monday.
Now, using The Events Calendar, here is the current call:
global $post;
$mondaysEvent = date(‘j M Y’, strtotime(‘this monday’));
$get_posts = tribe_get_events(array(‘start_date’=>$mondaysEvent,’posts_per_page’=>1) );
if($get_posts):
foreach($get_posts as $post) {
setup_postdata($post);/* event specific code */
} // end foreach
else:
/* no event today specific code */
endif;
wp_reset_query();Forgive the lack of styling, but here is what that’s returning: http://curelounge.com/event-list/
Any thoughts? Thank you!
June 5, 2012 at 2:24 pm #20184JonahParticipantHi Jeremy,
Are you asking about detecting this only in the events list view? Have you looked through our documentation? https://theeventscalendar.com/support/documentation/
– Jonah
June 5, 2012 at 2:25 pm #20185JonahParticipantIn the above query, that’s pretty much how you’d do it where if($get_posts) is blank do something else…
June 11, 2012 at 8:24 am #20471JeremyMemberHi Jonah,
Thanks for the response – yes, the above query is based on the documentation. (I’ve since taken down the page but it wasn’t returning properly. Example: I call Monday and it returned Tuesday’s event that ended Monday morning. I call Sunday and it returns Saturday’s event that ends Sunday morning at 2:00 a.m.)
I have a feeling ECP is conflicting either with a plugin or some date.time declaration. I don’t have a resolution to this issue, but I don’t have an explanation to help out with the problem either so feel free to consider this topic closed.
If I find out any more about why things are returning the way they are, I definitely report.
Cheers.
June 11, 2012 at 8:39 am #20474JonahParticipantSounds good Jeremy, I’m closing this thread.
-
AuthorPosts
- The topic ‘Styling weekly event list where there is no event.’ is closed to new replies.