Accessing all venues data

Home Forums Calendar Products Events Calendar PRO Accessing all venues data

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #76410
    randalldon
    Participant

    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.

    #76418
    Chris
    Participant

    For the featured image:
    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

    For 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_link

    And 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_post

    #76420
    randalldon
    Participant

    Hi 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

    #76427
    Chris
    Participant

    I’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’

    #76430
    randalldon
    Participant

    Hi Chris,

    That’s great the ‘tribe_venue’ post type was what i was looking for.

    Many thanks

    #76431
    Chris
    Participant

    Not 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

    #982385
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Accessing all venues data’ is closed to new replies.