Custom Time field in Month view repeats

Home Forums Calendar Products Events Calendar PRO Custom Time field in Month view repeats

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1611488
    Jason
    Participant

    Noticed 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-# -->
    #1612832
    Andras
    Keymaster

    Hi 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,
    Andras

    #1613036
    Jason
    Participant

    I’ve uncommented the code above on our live page so you can see the issue:

    https://events.mansfieldstpeters.org/events/

    #1613891
    Andras
    Keymaster

    Hi,
    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,
    Andras

    #1615032
    Jason
    Participant

    Thanks for your help! Much appreciated.

    #1615974
    Andras
    Keymaster

    You’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,
    Andras

    PS: 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/

     

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Custom Time field in Month view repeats’ is closed to new replies.