Home › Forums › Calendar Products › Events Calendar PRO › Custom Time field in Month view repeats
- This topic has 5 replies, 2 voices, and was last updated 7 years, 7 months ago by
Jason.
-
AuthorPosts
-
September 1, 2018 at 1:02 pm #1611488
Jason
ParticipantNoticed after a recent update that the time on our month view (Custom file in our theme pack) was showing the same time for all events & room code.) Being the non-technical guru, I’m not sure what changed in the script. I’m at your mercy to help locate the change. I made sure we were using the latest version of the single-event.php file from the plugin.
<div id="tribe-events-event-<?php echo esc_attr( $event_id ); ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo esc_attr( tribe_events_template_data( $post ) ); ?>'> <div class="event-time"><?php if(!tribe_event_is_all_day()){ echo tribe_get_start_date($post->ID, false,'g:ia');} ?></div> <h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a><br /><span class="tribe-events-override"><?php echo tribe_custom_field('Room Code'); ?></span></h3> </div><!-- #tribe-events-event-# -->September 4, 2018 at 3:33 am #1612832Andras
KeymasterHi Jason,
Thanks for reaching out!
I haven’t been able to pinpoint the issue on your site.
Could you share with me a URL where the issue is visible? A screenshot with some markup would also be very helpful.
Thanks and cheers,
AndrasSeptember 4, 2018 at 8:04 am #1613036Jason
ParticipantI’ve uncommented the code above on our live page so you can see the issue:
September 5, 2018 at 1:56 am #1613891Andras
KeymasterHi,
Thanks, that made it easier.After some tinkering this is how you can fix it:
At the beginning of the file declare the post id as well, like:
$post_id = $post->ID;Then adjust your code a bit:
[code language=”php”]
<?php
if ( ! tribe_event_is_all_day( $post_id ) ) {
echo tribe_get_start_date( $post_id, false, ‘g:ia’ );
}
?>
[/code]This worked for me.
Let me know if it also does the trick for you.Cheers,
AndrasSeptember 6, 2018 at 6:05 am #1615032Jason
ParticipantThanks for your help! Much appreciated.
September 7, 2018 at 1:58 am #1615974Andras
KeymasterYou’re welcome, Jason! Happy to hear it worked.
Just a note, it looks like we have a small glitch in the code somewhere, that is why your solution with the reference to “$post->ID” did not work, which should btw. Our devs are going to take a look at it.
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.
Cheers,
AndrasPS: We’d be grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Thanks!
PS2: If you like our plugins, and you didn’t yet do so 🙂 we would also be happy to receive a review in the wordpress.org repository. Much appreciated!
https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
https://wordpress.org/support/view/plugin-reviews/event-tickets/ -
AuthorPosts
- The topic ‘Custom Time field in Month view repeats’ is closed to new replies.
