Linking an event to a place needs the GeoDirectory Custom Post Types add-on. It adds the field where you choose the place, and the GD > Linked Posts block that shows the link on the details page.
Link events to places
- Install and activate the Custom Post Types add-on.
- Open the settings for Events and allow events to link to Places in the Link Posts settings.
- Add the Link Posts field for Places to the Events custom fields, so the event form has a place selector.
- Edit an event, choose its place in that field and save.
How to Link Two Custom Post Types? shows these settings with screenshots.
Show the place on the event page
Edit the details template used by events and add a GD > Linked Posts block where the place should appear. Set Link type to the listings this one links to, Post type to Places, and the number of listings to 1. As a shortcode:
[gd_linked_posts link_type="to" post_type="gd_place" post_limit="1"]
The place appears as a listing that links to its own page.
Show the events on the place page
The link works in the other direction too. On the template used by places, use link type “from” with the events post type:
[gd_linked_posts link_type="from" post_type="gd_event" post_limit="5"]
If nothing shows
- Check that the event actually has a place selected. The block shows nothing for listings without a link.
- Check the direction. Events link to places, so the event page uses “to” and the place page uses “from”.
- Set the post type in the block. Left on Auto it uses the post type of the page being viewed, which on an event page is Events.
All the block settings are in GD > Linked Posts.