Month View Issue with Events that Arent' All day
-
Hello,
I slightly Modified the Month view to Include the content of of some posts so tht I can display a school day number along with the day number of the months – this is for a school.
The issue I’m having is it all works fine, except when I try to pull the content from days that have an event that is timed, and not all day.
on those days the content from the not all day event is pulled instead of the one from the header – I figure it may be possible if there is a conditional to pull only posts from a certain category, but I’m not sure how to do this as ithink the categories in this plugin work differently.
Look at the 9th, and the 23rd, I changed the 9th to an all day event, so the next day it shows the school day on the calendar. However on the 23rd I used the time function to set the hours of the event instead of setting it to all day – then it pulls the content from that post instead. Here is the modifications I made to the single-day.php file.
<?php /** * Month View Single Day * This file contains one day in the month grid * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-day.php * * @package TribeEventsCalendar * */ if ( !defined('ABSPATH') ) { die('-1'); } ?> <strong><?php remove_filter ('the_content', 'wpautop'); ?></strong> <?php $day = tribe_events_get_current_month_day(); ?> <?php if ( $day['date'] != 'previous' && $day['date'] != 'next' ) : ?> <!-- Day Header --> <div id="tribe-events-daynum-<?php echo $day['daynum'] ?>"> <strong><?php if ( $day['total_events'] > 0 && tribe_events_is_view_enabled( 'day' ) ) { ?> <?php echo $day['daynum'] ?> <?php } else { ?> <?php echo $day['daynum'] ?>| School Day - <?php the_content(''); ?> <?php } ?></strong> </div> <!-- Events List --> <?php while ($day['events']->have_posts()) : $day['events']->the_post() ?> <?php tribe_get_template_part('month/single', 'event') ?> <?php endwhile; ?> <!-- View More --> <?php if ( $day['view_more'] && tribe_events_is_view_enabled( 'day' ) ) : ?> <div class="tribe-events-viewmore"> <?php if($day['total_events'] > 1 || $day['total_events'] == 0) { $events_label = __( 'Events ', 'tribe-events-calendar' ); } else { $events_label = __( 'Event ', 'tribe-events-calendar' ); } ?> <a href="<?php echo $day['view_more'] ?>">View All <?php echo $day['total_events'] . " " . $events_label ?> »</a> </div> <?php endif ?> <?php endif; ?>
Suggestions anyone?
Thanks~!
- The topic ‘Month View Issue with Events that Arent' All day’ is closed to new replies.