How to Link Two Custom Post Types?

You can link different Custom Post Types to each other, for example:

  • all events at a venue
  • all doctors in a hospital
  • jobs to a business

Preparation

  1. Create the two Custom Post Types you want to link, for example Events and Venues.
  2. The Events will be added to the Venue in our example. To enable that, go to Events > Settings > Custom Fields tab and click on Link Posts: Venue on the left hand side to add the custom field to the list on the right hand side.
  3. Open the custom field and edit as required:
  4. Open the Advanced Settings and choose if a new Event can be added to Venues of other users, or if Events can only be added to Venues that are owned by the same user:

Usage

  1. Users will now be able to search for Venues and connect the Events to the Venue selected, when they add an Event using the Add Listing form:

Frontend result

There are different options to link the Events to the Venue on the frontend.
Use the GD > Linked Posts element, which can be used as a shortcode, widget or block.
Below is one example how to show the Events on the Venue page, and the Venue on the Events pages.

Add a tab to the Venue Detail page
  1. Add a linked-from-gd-event shortcode field as a tab at Venues > Settings > Tabs tab (adjust for your Custom Post Types), and edit as required:
  2. This is how it will look on the Detail page for the Venue:
Add a tab to the Events Detail pages
  1. Add a linked-to-gd-place shortcode field as a tab at Events > Settings > Tabs tab (adjust for your Custom Post Types), and edit as required:
  2. This is how it will look on the Event's Detail page:
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us