Home › Forums › Calendar Products › Events Calendar PRO › Calendar widget displaying current time + 6hours on first item
- This topic has 5 replies, 2 voices, and was last updated 8 years, 11 months ago by
dmystudio.
-
AuthorPosts
-
April 12, 2017 at 3:35 pm #1269189
dmystudio
ParticipantPlease please help…
The Calendar widget displaying on our home page is displaying current time + 6hours on first item only. So time keeps changing and is not displaying correct, fixed time. It’s the weirdest thing….
If I delete the event, the rest of the events appear fine.
The site is fairly new – but this is the first time we’ve seen this. I don’t mind paying for support – I REALLY REALLY need to fins a solution asap.
It’s not a plugin conflict. It’s not a theme conflict, etc….
TEC is pretty customized on this site… I suspect it has to do with customizations to single-event.php which I included below.
/************
<div class=”list-date”>
<?php
if (
isset( $instance[‘tribe_is_list_widget’] )
&& date( ‘m’, $post_date ) != date( ‘m’, current_time( ‘timestamp’ ) )
) :
?>
<span class=”list-dayname”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘F’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
<?php echo apply_filters( ‘tribe-mini_helper_tribe_events_ajax_list_daynumber’,
date_i18n( ‘d’, $post_date ), $post_date, $mini_cal_event_atts[‘class’] ); ?>
</span><span class=”list-dayweek”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘l’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
</span><span class=”list-daytime”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘g:i a’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
</span><?php else: ?>
<span class=”list-dayname”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘M j’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
</span>
<span class=”list-dayweek”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘l’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
</span><span class=”list-daytime”>
<?php
echo apply_filters(
‘tribe-mini_helper_tribe_events_ajax_list_dayname’,
date_i18n( ‘g:i a’, $post_date ),
$post_date,
$mini_cal_event_atts[‘class’]
);
?>
</span><?php endif; ?>
</div>
************/April 14, 2017 at 7:25 pm #1270343Trisha
MemberHi Denise,
Wow, I can definitely see your frustration! I think I know what’s going on but let’s try something to be sure.
The code you sent is (I assume) copied directly from the single-event template for widgets. When I paste that as it is into my theme I don’t get the correct date because there are a few missing variables…so try this: Paste the following code at the very top of the same file that you got this code from.
$mini_cal_event_atts = tribe_events_get_widget_event_atts();
$post_date = tribe_events_get_widget_event_post_date();
$post_id = get_the_ID();
$organizer_ids = tribe_get_organizer_ids();
$multiple_organizers = count( $organizer_ids ) > 1;
$city_name = ! empty( $city ) ? tribe_get_city() : '';
$region_name = ! empty( $region ) ? tribe_get_region() : '';
$zip_text = ! empty( $zip ) ? tribe_get_zip() : '';
$has_address_details = ! empty( $city_name ) || ! empty( $region_name ) || ! empty( $zip_text );This is, of course, provided it’s not already there. If it is we have a different problem 😉
Let me know how it goes!
Cheers,
TrishaMay 1, 2017 at 4:10 pm #1276991dmystudio
ParticipantHi Trisha,
I though I had corrected the problem as we have not seen it in the past two weeks, but it has shown up again. I tried doing as you asked above – it completely changed the layout and what we needed, as we have customized the widget A LOT (although things were displaying correctly, just not what we need to display). We don’t actually link to any of the event pages – links are directed to show pages that are outside of TEC generated pages via custom fields… I muddle my way through php, apparently enough to make a good mess of things 🙂
Right now, everything looks almost fine – except that this evening’s event is not listed. Earlier today it was listed with the incorrect time as described above… changing every minute. I think it now thinks the event is over…
Here is the entire messy single-event.php
<?php /** * Single Event Template for Widgets * * * @version 4.4 * * @package TribeEventsCalendarPro * */ $mini_cal_event_atts = tribe_events_get_widget_event_atts(); $post_date = tribe_events_get_widget_event_post_date(); $post_id = get_the_ID(); $organizer_ids = tribe_get_organizer_ids(); $multiple_organizers = count( $organizer_ids ) > 1; ?> <div class="tribe-mini-calendar-event event-<?php esc_attr_e( $mini_cal_event_atts['current_post'] ); ?> <?php esc_attr_e( $mini_cal_event_atts['class'] ); ?>"> <?php if ( tribe( 'tec.featured_events' )->is_featured( $post_id ) && get_post_thumbnail_id( $post_id ) ) { /** * Fire an action before the list widget featured image */ do_action( 'tribe_events_list_widget_before_the_event_image' ); /** * Allow the default post thumbnail size to be filtered * * @param $size */ $thumbnail_size = apply_filters( 'tribe_events_list_widget_thumbnail_size', 'post-thumbnail' ); ?> <div class="tribe-event-image"> <?php the_post_thumbnail( $thumbnail_size ); ?> </div> <?php /** * Fire an action after the list widget featured image */ do_action( 'tribe_events_list_widget_before_the_event_image' ); } ?> <div class="list-date"> <?php if ( isset( $instance['tribe_is_list_widget'] ) && date( 'm', $post_date ) != date( 'm', current_time( 'timestamp' ) ) ) : ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'M j', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <span class="list-dayweek"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'l', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <span class="list-daytime"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'g:i a', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php else: ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'M j', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <span class="list-dayweek"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'l', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <span class="list-daytime"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'g:i a', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php endif; ?> </div> <div class="list-info"> <?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?> <h4 class="tribe-events-title"> <a href="<?php echo esc_url( $showlink ); ?>" rel="bookmark"><?php the_title(); ?></a> </h4> <?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?> <div class="learn-buy"> <?php if(get_field('link')) { echo '<a href="'. get_field('link') .'" class="learn-more">Learn More</a>'; } ?> <?php if(get_field('performance_no')) { echo '<a href="https://tickets.northcoastrep.org/TheatreManager/1/online?performance='. get_field('performance_no') .' " class="buy_tix">Buy Tickets</a>'; } ?></div> </div> <div class="event-button-<?php the_field('event_type'); ?>"> <div class="stage"> <?php if( get_field('event_type') == 'Main Stage' ): ?> <a href="shows-and-tickets/mainstage/"><?php the_field('event_type'); ?></a> <?php endif; ?> <?php if( get_field('event_type') == 'Variety Night' ): ?> <a href="shows-and-tickets/variety-nights-at-north-coast-rep/"><?php the_field('event_type'); ?></a> <?php endif; ?> <?php if( get_field('event_type') == 'Reading' ): ?> <a href="new-works-reading-series/"><?php the_field('event_type'); ?></a> <?php endif; ?> <?php if( get_field('event_type') == 'Donor Event' ): ?> <a href="donor-events/"><?php the_field('event_type'); ?></a> <?php endif; ?> <?php if( get_field('event_type') == 'Volunteer Event' ): ?> <a href="support-us/volunteer/"><?php the_field('event_type'); ?></a> <?php endif; ?> </div> </div> <?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?> <!-- // Price, Venue Name, Address, City, State or Province, Postal Code, Country, Venue Phone, Organizer Name--> <?php ob_start(); ?> <?php if ( isset( $venue ) && $venue && tribe_get_venue() != '' ) : ?> <span class="tribe-events-venue"><?php echo tribe_get_venue_link(); ?></span> <?php endif ?> <?php if ( isset( $address ) && $address && tribe_get_address() != '' ): ?> <div class="tribe-street-address"><?php echo tribe_get_address(); ?></div> <?php endif ?> <?php if ( ( isset( $city ) && $city && $city = tribe_get_city() ) || ( isset( $region ) && $region && $region = tribe_get_region() ) || ( isset( $zip ) && $zip && $zip = tribe_get_zip() ) ) : ?> <div> <?php if ( isset( $city ) && $city ) : ?> <span class="tribe-events-locality"><?php echo $city; ?></span> <?php endif ?> <?php if ( isset( $region ) && $region ) : ?> <span class="tribe-events-region"><?php echo $region; ?></span> <?php endif ?> <?php if ( isset( $zip ) && $zip ) : ?> <span class="tribe-events-postal-code"><?php echo $zip; ?></span> <?php endif ?> </div> <?php endif; ?> <?php if ( isset( $country ) && $country && tribe_get_country() != '' ) : ?> <div class="tribe-country-name"><?php echo tribe_get_country(); ?></div> <?php endif ?> <?php if ( isset( $phone ) && $phone && tribe_get_phone() != '' ) : ?> <span class="tribe-events-tel"><?php echo tribe_get_phone(); ?></span> <?php endif ?> <?php if ( $location = trim( ob_get_clean() ) ) : ?> <div class="tribe-events-location tribe-section-s"> <?php echo $location; ?> </div> <?php endif; ?> <?php ob_start(); ?> <?php if ( isset( $organizer ) && $organizer && ! empty( $organizer_ids ) ) : ?> <span class="tribe-events-organizer"> <?php echo tribe_get_organizer_label( ! $multiple_organizers ); ?>: <?php $organizer_links = array(); foreach ( $organizer_ids as $organizer_id ) { if ( ! $organizer_id ) { continue; } $organizer_link = tribe_get_organizer_link( $organizer_id, true ); $organizer_phone = tribe_get_organizer_phone( $organizer_id ); if ( ! empty( $organizer_phone ) ) { $organizer_link .= '<div class="tribe-events-tel">' . $organizer_phone . '</div>'; } $organizer_links[] = $organizer_link; }// end foreach $and = _x( 'and', 'list separator for final two elements', 'tribe-events-calendar-pro' ); if ( 1 == count( $organizer_links ) ) { echo $organizer_links[0]; } elseif ( 2 == count( $organizer_links ) ) { echo $organizer_links[0] . ' ' . esc_html( $and ) . ' ' . $organizer_links[1]; } else { $last_organizer = array_pop( $organizer_links ); echo implode( ', ', $organizer_links ); echo esc_html( ', ' . $and . ' ' ); echo $last_organizer; }// end else ?> </span> <?php endif ?> <?php if ( $organizers = trim( ob_get_clean() ) ) : ?> <div class="tribe-events-organizer tribe-section-s"> <?php echo $organizers; ?> </div> <?php endif; ?> <?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?> </div> <!-- .list-info -->The site is https://northcoastrep.org.
I know that this is outside of what you would typically help people with!! I am very grateful for any help you may have to offer. I set-up a staging site so that I don’t mess with the live site. If you want credential, I’d be so happy to give them to you.
Need to take a php class pronto!!
With thanks,
DeniseMay 2, 2017 at 9:30 pm #1277808Trisha
MemberHi, Denise!
Now you have me curious! I see some things in the code I’d like to test, particularly some of the conditionals and the current time configuration. Would you mind doing an export of your custom fields and attaching it here? Feel free to mark your reply as private if you like 🙂
I’ll wait to hear from you!
Cheers,
TrishaMay 24, 2017 at 9:35 am #1288410Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Calendar widget displaying current time + 6hours on first item’ is closed to new replies.
