• Resolved shanDB

    (@shandb)


    I’ve picked up a clients website that is using “the events calendar”.

    The is a spot on the site the showcases three featured events.
    However it is displaying the original start time from the first event in the series for any recurring event.

    i would like it to display the NEXT date for any recurring events.

    The code used to display the event date is as follows:

    echo tribe_get_start_date( $event, false, 'd' );

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Brook

    (@brook-tribe)

    Howdy Shandb,

    Thanks for sharing the code. That should be working. If it’s not then it would see that the variable $event is not for the proper post. Keep in mind each event in the series will have its own post ID, so you will need to nab the one for the specific date you are trying to display.

    Does that all make sense?

    Cheers!
    – Brook

    Thread Starter shanDB

    (@shandb)

    Thanks for the reply Brook, it’s helped me understand it just that little bit more – But unfortunately I still don’t have it working.

    So here’s what I’ve found..

    – Adding echo $event->ID gives me an ID number I can cross reference in phpMyAdmin database.

    – When I cross reference the ID, I can see that the database does infact have the starting date of the recurring event as the original first instance of the event.

    – back in my theme, I see the variable $events is being declared as follows:

    <?php
      // Retrieve the next 3 upcoming events
      $events = tribe_get_events( array(
        'posts_per_page' => 4,
        'orderby' => 'menu_order',
      ) );
    ?>

    And further down a loop is opened to display each event:
    <?php foreach( $events as $event ): ?>

    Within the loop, the event date is called like this:
    <?php echo tribe_get_start_date( $event, false, 'F, d' ); ?>

    Now, my confusion is: In your reply above you mention the post ID. But I don’t see this variable anywhere. Any attempts to replace $event with $post is breaking the page.

    It seems that since $event->ID returns the ID for the first instance of the repeating event, I’m not sure how to find the ID of the most recent upcoming event in the recurring series.

    Hi. You say that you have recurring events, which is only available in our PRO add-on.

    As such, please post in our Premium Support Forums because we only provide support for bug reporting in the free .org forum.

    Thanks for your understanding.

    Thread Starter shanDB

    (@shandb)

    Hi Clifford,

    I am unable to post in the premium forum because I don’t have an active subscription.

    I’m a web developer that has taken on this client. The clients website uses the premium version, which was installed by the previous developer. The client was unable to provide me with any premium login details. The previous developer is no longer contactable.

    Hence, why I’m posting in this forum.
    Back to square one. The problem still exists.

    Sorry to hear that. We’ve seen this scenario before.

    Could the customer provide us a copy of their purchase receipt, the email address that was used to purchase, or any other verification? If yes, please send to support@theeventscalendar.com

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Recurring events – Echo the next date’ is closed to new replies.