Get list of recurring events (into single-events.php)

Home Forums Calendar Products Events Calendar PRO Get list of recurring events (into single-events.php)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1120768
    Dominik Schneider
    Participant

    Hi there,
    I’m using the recurrence feature from The Event Calendar Pro. I need to know, how to get a list (ordered by date) of all recurring events of one event/post.

    The event has some dates like:
    10.9. | Mon. | 1:00pm
    11.9. | Tue. | 1:00pm
    12.9. | Wed. | 1:00pm

    I’ve found a way, to get displayed a list of 3 related post by using the “tribe_get_related_posts();”.
    But in this case, I only get max. 3 random events without any order.

    Thanks!


    <?php
    $posts = tribe_get_related_posts();
    if ( is_array( $posts ) && ! empty( $posts ) ) : ?>

    <?php endif; ?>

    #1121021
    Josh
    Participant

    Hey Dominik,

    Thanks for reaching out to us!

    To set expectations to start, I am limited in the amount of support that I am able to provide here in regards to customization. However, have a look at this snippet and associated notes to see if it helps to get you pointed in the right direction for what you’re trying to accomplish here.

    Let me know if this helps.

    Thanks!

    #1121507
    Dominik Schneider
    Participant

    This reply is private.

    #1121509
    Dominik Schneider
    Participant

    Hi Josh,

    thank you so much for the code snippet! It is very useful. Can’t believe this feature is not available as basic option within the plugin.

    Instead of counting other occurence, it would be better to get displayed the date of the recurring events.

    printf( '<li><a href="%s">Other occurrence #%d</a></li>', esc_url( tribe_get_event_link( $value ) ), $key+1 );

    Do you know, what kind of querie I can use, to get display the date of the recurring event? Can’t find it in the Themer’s guide of TheEventCalendar.

    Thanks!

    #1122093
    Josh
    Participant

    Hey Dominik,

    Awesome! Happy that helped!

    Instead of using the “$key+1” value at the end there, you should be able to use “tribe_get_start_date( $value ) ” to get the date of the occurrence.

    Also, this does sound like a good potential feature for the plugin. If you would like, you can add your voice to the suggestion on our UserVoice page.

    Let me know if this helps.

    Thanks!

    #1128864
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Get list of recurring events (into single-events.php)’ is closed to new replies.