Home › Forums › Calendar Products › Events Calendar PRO › Get list of recurring events (into single-events.php)
- This topic has 6 replies, 4 voices, and was last updated 9 years, 10 months ago by
Dominik Schneider.
-
AuthorPosts
-
May 31, 2016 at 11:07 am #1120768
Dominik Schneider
ParticipantHi 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:00pmI’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 foreach ( $posts as $post ) : ?>
-
" class="tribe-event-url" rel="bookmark">
<?php echo tribe_get_start_date($post->ID, false, j); ?>.<?php echo tribe_get_start_date($post->ID, false,m); ?>.<?php echo tribe_get_start_date($post->ID, false,y); ?> | <?php echo tribe_get_start_date($post->ID, false, D); ?>. | <?php echo tribe_get_start_date($post->ID, false, 'H:i'); ?> o'clock
<?php endforeach; ?>
<?php endif; ?>
May 31, 2016 at 8:28 pm #1121021Josh
ParticipantHey 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!
June 2, 2016 at 2:15 am #1121507Dominik Schneider
ParticipantThis reply is private.
June 2, 2016 at 2:16 am #1121509Dominik Schneider
ParticipantHi 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!
June 3, 2016 at 4:52 am #1122093Josh
ParticipantHey 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!
June 18, 2016 at 9:35 am #1128864Support Droid
KeymasterThis 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. -
" class="tribe-event-url" rel="bookmark">
-
AuthorPosts
- The topic ‘Get list of recurring events (into single-events.php)’ is closed to new replies.
