Displaying past events with WP_query doesn’t work

Home Forums Calendar Products Events Calendar PRO Displaying past events with WP_query doesn’t work

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1359354
    renaud maupoux
    Participant

    Hello,
    I’d like to make a loop to get all my events in a slide with WP_Query.
    I made something like that :

    $args = array( ‘post_type’ => ‘tribe_events’,
    ‘posts_per_page’ =>-1
    );
    $the_query = new WP_Query( $args ); ?>

    But it only works with next events how can I do to get the past one
    Thanks

    #1359397
    renaud maupoux
    Participant

    I solved this by adding
    ‘eventDisplay’ => ‘custom’
    in args :

    $args = array( ‘post_type’ => ‘tribe_events’,
    ‘posts_per_page’ =>-1, //Pour tous les avoir
    ‘eventDisplay’ => ‘custom’,

    #1359893
    Jennifer
    Keymaster

    Hi Renaud,

    I’m glad to hear you were able to get this resolved, and thanks for sharing your solution here! If you haven’t done so already, I’d recommend taking a look at our themer’s guide, as well as the tribe_get_events function, which is very similar to WP_Query but meant specifically for pulling custom event queries.

    If you have any other questions, please don’t hesitate to ask!

    Thanks,

    Jennifer

    #1370212
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Displaying past events with WP_query doesn’t work’ is closed to new replies.