Home › Forums › Calendar Products › Community Events › query by country – City – Other fields
- This topic has 8 replies, 2 voices, and was last updated 9 years, 7 months ago by Casey.
-
AuthorPosts
-
June 30, 2014 at 3:08 pm #262749xumusParticipant
Hi, I would like you could help me to know how to query using the fields of the event like country, city, etc. and tell me another options that could be use to query using tribe events plugin. Thanks
July 1, 2014 at 8:59 am #264675CaseyParticipantxumus,
Thanks for getting in touch! You can use the tribe_get_events() function to query Events just like would with get_posts(). Here are some code examples using tribe_get_events() to query Events.You can also perform Meta Queries using tribe_get_events(), and you can view the Meta Keys to query off of by installing a plugin like post meta inspector, which will allow you to see the Post Meta keys for each event (screnshot).
Hopefully that points you in the right direction. Thanks! ๐
-Casey-
July 20, 2014 at 9:04 pm #466425CaseyParticipantI just wanted to follow up and see if youโre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! ๐
-Casey-
August 1, 2014 at 12:07 am #554428xumusParticipantThe query codes you refer are not really usefull for me, because there is not an example for use venue country, venue city, etc. into the query and when I use it like get_post doesn’t work too. I would like you could tell another way to query by country and not by venueID please. Thanks
August 1, 2014 at 7:15 am #557303CaseyParticipantxumus,
First, you’ll have to query the Venues custom post type using the Country post meta field as your search parameter, in order to retrieve the Venue IDs to use in your tribe_get_events() Meta Query.Hopefully that points you in the right direction. Good luck!
Thanks! ๐
-Casey-
August 1, 2014 at 10:37 pm #563836xumusParticipantThis reply is private.
August 5, 2014 at 12:42 pm #589647CaseyParticipantxumus,
I’ve put together a little code snippet that should show you how to do something like this. Take a look here: https://gist.github.com/ckpicker/b247169a4f124fa6ea7c My example shows you how to query Venues based on City / Country, and then use those Venue IDs to query associated Events.Hopefully that points you in the right direction, but let me know if you have further questions. Thanks! ๐
-Casey-
August 28, 2014 at 6:47 am #706406CaseyParticipantI just wanted to follow up and see if youโre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! ๐
-Casey-
September 8, 2014 at 6:12 am #730442CaseyParticipantSince I havenโt heard back from you here, Iโm going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! ๐
-Casey-
-
AuthorPosts
- The topic ‘query by country – City – Other fields’ is closed to new replies.