Showing the first upcoming recurring event in a loop?

Home Forums Calendar Products Events Calendar PRO Showing the first upcoming recurring event in a loop?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #766253
    jennahoward
    Participant

    Is there a meta key I can add to a loop to show the first upcoming recurring event in a loop? Below is the current query and args I have in place:
    Thanks in advance for any help.
    <?php

    $today = date(‘Y-m-d’);
    $lastDayOfMonth = date(‘Y-m-d’, strtotime(‘+45 day’));

    $args=array(
    ‘start_date’ => $today,
    ‘end_date’=> $lastDayOfMonth,
    ‘eventDisplay’ => ‘all’,
    ‘post_type’ => ‘tribe_events’,
    ‘meta_key’ => ‘_EventStartDate’,
    ‘orderby’ => ‘event_date’,
    ‘order’ => ‘ASC’,
    ‘posts_per_page’ => -1,
    ‘tax_query’=> array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => array( ‘everyone-home’, ‘kids-home’, ‘teens-featured’, ‘adults-home’ )
    )
    )
    );
    $query = new WP_Query($args); ?>

    #766655
    jennahoward
    Participant

    Can anyone help?

    #768749
    Brook
    Participant

    Howdy jennahoward,

    Pardon my delayed response. We do our best to answer questions within 24 hours, but yesterday our staff was stretched too thin.

    I think you will be interested in reviewing this short function. Basically it shows what happens ifg the query_varĀ tribeHideRecurrence is set to 1. It adds a bit of SQL to hide all but the first upcoming event. Is that what you are looking for? Are you able to accomplish your goal now? If not, mind elaborating a bit on what you need? Thanks!

    – Brook

    #809227
    Brook
    Participant

    Since this topic has gone for a spell without a response I am going to archive it. If you do need anything else please feel free to open a new topic. Cheers!

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Showing the first upcoming recurring event in a loop?’ is closed to new replies.