• Resolved SmashedUpSanity

    (@smashedupsanity)


    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.

    http://www.prsdmb.ca/events/

    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 ?> &raquo;</a>
    		</div>
    	<?php endif ?>
    
    <?php endif; ?>

    Suggestions anyone?

    Thanks~!

    https://wordpress.org/plugins/the-events-calendar/

Viewing 1 replies (of 1 total)
  • Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi SmashedUpSanity,

    Thanks for your post. I’m sorry to hear you’re encountering issues with your customizations. While we do want to make sure we’re serving everyone as best we can, we’re also limited here at the dot-org forum to only providing support for bugs in the plugin codebase (as outlined in the forum guidelines that exist as a sticky post at the front page).

    It looks like the issue you’re reporting here unfortunately falls outside that scope. We want to do our best to get you sorted, though, and so here are some resources that might be helpful:

    Themer’s Guide – provides an overview of how to customize the plugin’s frontend appearance.
    Tutorials – useful tips and tricks for changing how the plugin looks and behaves.
    Technical Docs – provides an overview of the classes and functions in each plugin

    Perhaps someone else on the forum will be able to help you out too. Good luck, and thanks for using The Events Calendar!

    ~Leah

Viewing 1 replies (of 1 total)
  • The topic ‘Month View Issue with Events that Arent' All day’ is closed to new replies.