Home › Forums › Calendar Products › Events Calendar PRO › Accessing all venues data
- This topic has 6 replies, 3 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
November 14, 2013 at 5:20 am #76410randalldonParticipant
Following on from my recent forum communications with Julie in the pre-sale forum https://theeventscalendar.com/support/forums/topic/venus-page-funtionality/#post-76191 and Barry in the WordPress forum http://wordpress.org/support/topic/venues-page i have upgraded to the Pro version in order to get the single venue pages which works great. However, and the main part of my initial query prior to purchase was how i can access the data for all venues (title, link & featured image) in order for this to be output in a loop scenario in a page template that could be accessed on a url such as http://www.examplesite.com/venues/ or similar.
This is essential functionality really for my current project and so i really need to find a way of achieving this and so any help would be hugely appreciated.
November 14, 2013 at 6:15 am #76418ChrisParticipantFor the featured image:
http://codex.wordpress.org/Function_Reference/the_post_thumbnailFor the link to the page, just do get_permalink($id_of_event) and then put that in a link or use
http://codex.wordpress.org/Function_Reference/get_page_linkAnd to get title, you can just instantiate a WP_Post object,
http://codex.wordpress.org/Class_Reference/WP_Post
or get_post:
http://codex.wordpress.org/Function_Reference/get_postNovember 14, 2013 at 6:28 am #76420randalldonParticipantHi Chris,
Thanks for coming back to me. Whilst i’m aware of how to get the title and image date my query relates to how to query just ‘venues’ in this. I wish to loop through all venues and output the data.
Many thnaks
November 14, 2013 at 6:41 am #76427ChrisParticipantI’m presuming you’re running a WP_Query already to make the loop, so all you’d need to do is just limit them to tribe_venue by doing ‘post_type’ => ‘tribe_venue’
November 14, 2013 at 6:47 am #76430randalldonParticipantHi Chris,
That’s great the ‘tribe_venue’ post type was what i was looking for.
Many thanks
November 14, 2013 at 6:49 am #76431ChrisParticipantNot a problem, to be more future safe, you might want to instead use TribeEvents::VENUE_POST_TYPE where ‘tribe_venue’ is. No ”s around that though since it’s a PHP constant
July 7, 2015 at 6:29 am #982385Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Accessing all venues data’ is closed to new replies.