Show Recurring Events

Home Forums Calendar Products Events Calendar PRO Show Recurring Events

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #1131717
    Nico
    Member

    This reply is private.

    #1132423
    Oliver Mark
    Participant

    Hi, Nico.

    Thanks for the reply.

    In order to see the events, you have to go the portuguese posts. Your profile is showing the english posts by default. I’m sorry I didn’t say this before.

    About the events list, yes, I’m looking to always show all recurrences of an upcoming recurring event.

    Let me know if I can help with something else.

    Regards.

    #1133210
    Nico
    Member

    Hey Oliver,

    Thanks for the patience here! I crafted a little code snippet in order the get this done, please try pasting it in your theme (or child theme) functions.php file:


    /* Tribe - insert a list of upcoming instances for recurring events in the list widget */
    function tribe_inject_recurring_instances ( ) {

    if ( !tribe_is_recurring_event ( ) ) return;

    $event_id = Tribe__Events__Main::postIdHelper( null );
    $post = get_post( $event_id );

    $parent_id = $post->post_parent;

    if ( !$parent_id ) $parent_id = $event_id;

    $child_events = tribe_get_events( array( 'eventDisplay' => 'list', 'post_parent' => $parent_id, 'post__not_in' => array( $event_id ) ) );

    if ( empty ($child_events) ) return;

    echo '

      ';
      foreach ( $child_events as $post ) { setup_postdata( $post );

      echo '

    • ' . $post->post_title . ' - ' . tribe_get_start_date( $post ) . '
    • ';
      }
      echo '

    ';
    }

    add_action('tribe_events_list_widget_after_the_meta', 'tribe_inject_recurring_instances' );

    Please let me know if this works as intended,
    Best,
    Nico

    #1135079
    Oliver Mark
    Participant

    Hi, Nico!

    Thank you for the patience!

    Your code works like a charm! It is exactly what I was looking for.

    I’m marking this thread as resolved.

    Thank you very much for your assistance during the last few weeks.

    Best regards

    #1135098
    Nico
    Member

    Super stocked to hear Oliver! Thanks for the patience on your side as well 🙂

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 5 posts - 16 through 20 (of 20 total)
  • The topic ‘Show Recurring Events’ is closed to new replies.