Get all Cities related to a repeated event

Home Forums Calendar Products Filter Bar Get all Cities related to a repeated event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #944148
    Matteo
    Participant

    Hi, thanks for your time.
    Please, is there a way to query the database and get all the Cities (_VenueCity) of an event repeated multiple time in different places?

    e.g. (same city means same venue in db):
    event A in venue 1 -> New York
    event A in venue 2 -> Chicago
    event A in venue 3 -> San Francisco
    event B in venue 4 -> Philadephia
    event B in venue 5 -> Washington
    event c in venue 1 -> New york
    event C in venue 3 -> San Francisco
    event D in venue 6 -> Menphis
    event D in venue 7 -> Dallas

    I can’t figure out how to query the database and get all the Cities for each event.
    Is this possible? Can you put me in the right way?
    Best regards

    #944201
    Matteo
    Participant

    Hi, still me, to be more clear each event has a different ID (post_id) and the same Name (post_title) and i need to get all the Cities (_VenueCity) for all the events with same name (post_title).
    I can’t figure out how to hook the events in the post table with the venue in the postmeta.
    Is it possible? Can you help?
    Thanks again, best regards.

    #944520
    George
    Participant

    Hey Matteo,

    I’m curious, would using an Event Category here be a viable option for you? That way, you could give all these events with the same name but in different venues just by querying that event category. Then from that list of events, you could do whatever you need – extract the various cities from all the different events, etc.

    Would that work, or do you need a code solution here? If you do in fact need code, can you help clarify things a little bit? Your original example was hard for me to understand – sorry if it’s obvious and I’m just missing something, but as I understand it, basically, here’s the sort of thing you’re looking to do:

    • There are events with the same name, in other words it’s basically the same event, but only by name – each instance of the event is not just a recurring event, but actually each one is a separate, new, one-time event and each one is happening in a different Venue.
    • One thing these events have in common is their name – it’s the same title being used for all of these events, just each one is in a different venue (and presumably a different time, as well, right? Unless it’s all happening in one day or something…)
    • Your goal is to get a list of post IDs for the events, and then use these IDs to find all the different Venues that the events are taking place in.
    • So then finally, you use that original list of post IDs to get all the venues, and then return a list of the Venue “city names” for display somewhere

    Is that a correct understanding of your goals here? If so, please let me know what you think about using an event category, I think that would simplify a lot of things if it works for you.

    Cheers!
    George

    #947149
    Matteo
    Participant

    HI, thanks for your answer. You understud correctly, I guess your way is correct, and will solve my problem. Thanks a lot

    #947252
    George
    Participant

    Cool, thanks for the update Matteo! Be sure to keep backups of any custom code you write – if you play around with some of the ideas I shared and spend some time on this, I’m sure you’ll be able to patch something together 🙂

    Cheers!
    George

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Get all Cities related to a repeated event’ is closed to new replies.