Past Events via Posts 2 Post plugin

Home Forums Calendar Products Events Calendar PRO Past Events via Posts 2 Post plugin

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1009119
    Robert
    Participant

    Hi there,

    I’m working on a site where my events would need subpages. So I thought I’m going to register a CPT than I’ll connect it through Posts 2 Post plugin. But for some reason its only shows the future Events for some reason. I’ve read through the forum and in the latest thread (https://theeventscalendar.com/support/forums/topic/past-events-cant-be-found-via-posts-2-posts/) nothing happened about this issue. Could you guys please update me if there is any solution?

    Thanks,

    Robert

    #1009288
    Josh
    Participant

    Hey Robert,

    Thanks for reaching out to us!

    It looks like the resolution from the previous thread involved reaching out to the P2P creators. Based on Brian’s research it looks like the plugin should be pulling all the events but doesn’t look like there is anything we can do on our end to make them more compatible in this area.

    Let me know if this helps.

    Thanks!

    #1010061
    Robert
    Participant

    Are you sure you not crashing something with the query?

    Just because i can see some strange behavior:

        $args = array (
          "exclude" => array($promoted_event),
          "posts_per_page" => 4,
          "post_type" => "tribe_events",
          "orderby" => "event_date",
          "order" => "ASC"
        );

    $events = get_posts( $args );
    This gives me back the good result with 4 events past and future promoted excluded.

    $events = tribe_get_events( $args );
    This gives me back bad result because the excluded event is there.

    $events = new WP_Query( $args );
    This gives me back only the future events including the excluded event.

    Or if I add eventDisplay => 'custom' to the query args it gives back the same result like tribe_get_events( $args );

    So there should be something wrong no?

    #1010484
    Robert
    Participant

    Anyone?

    #1010489
    Josh
    Participant

    Hey Robert,

    Thanks for following up on this one.

    I’ll do some further research and reach out to our team on this one and get back to you shortly.

    Thanks!

    #1011306
    Josh
    Participant

    Hey Robert,

    I’ve done some further review on this one and I’m not sure there is a straightforward way to get the P2P relationship field to show all the events at this time. Would it be possible to switch the relationship format? Instead of trying to search the events within your post to make the connection, why not try to search the posts within your events?

    Let me know if this helps.

    Thanks!

    #1011798
    Robert
    Participant

    This is not only a P2P problem. The tribe_get_events(array("exclude" => array($promoted_event))) should also work. But for some reason its not excluding the given event. So i guess there should be some problem in the plugin custom query modifications.

    #1012170
    Robert
    Participant

    Hm, post__not_in works fine. But it still requires "eventDisplay" => "custom", argument in the query to work like a normal WP_Query. So I keep up that not P2P plugin uses wordpress functions in a bad way, but you should change the logic with this “eventDisplay” argument. It should be normal WP_Query without this argument, and you should use eventDisplay => "tribe" to make your custom queries working.

    Thanks!

    #1012742
    Josh
    Participant

    Hey Robert,

    Thanks for following up here and I’m glad you were able to find a resolution that works for you here.

    I can understand the argument here, my only counter would be that 90% of queries of events don’t require the past events and would actually be counter to what would be a desired output.

    Thanks!

    #1017248
    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 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Past Events via Posts 2 Post plugin’ is closed to new replies.