{"id":2684,"date":"2026-10-20T08:35:27","date_gmt":"2026-10-20T07:35:27","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/show-linked-place-on-event-page\/"},"modified":"2026-10-20T08:40:41","modified_gmt":"2026-10-20T07:40:41","slug":"show-linked-place-on-event-page","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/show-linked-place-on-event-page\/","title":{"rendered":"How to show the linked place on an event details page"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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 &gt; Linked Posts block that shows the link on the details page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Link events to places<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install and activate the Custom Post Types add-on.<\/li>\n\n\n\n<li>Open the settings for Events and allow events to link to Places in the Link Posts settings.<\/li>\n\n\n\n<li>Add the Link Posts field for Places to the Events custom fields, so the event form has a place selector.<\/li>\n\n\n\n<li>Edit an event, choose its place in that field and save.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/how-to-link-two-custom-post-types\/\">How to Link Two Custom Post Types?<\/a> shows these settings with screenshots.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Show the place on the event page<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the details template used by events and add a GD &gt; 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:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_linked_posts link_type=&quot;to&quot; post_type=&quot;gd_place&quot; post_limit=&quot;1&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The place appears as a listing that links to its own page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Show the events on the place page<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The link works in the other direction too. On the template used by places, use link type &#8220;from&#8221; with the events post type:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_linked_posts link_type=&quot;from&quot; post_type=&quot;gd_event&quot; post_limit=&quot;5&quot;&#093;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">If nothing shows<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check that the event actually has a place selected. The block shows nothing for listings without a link.<\/li>\n\n\n\n<li>Check the direction. Events link to places, so the event page uses &#8220;to&#8221; and the place page uses &#8220;from&#8221;.<\/li>\n\n\n\n<li>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.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">All the block settings are in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/gd-linked-posts\/\">GD &gt; Linked Posts<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &gt; Linked Posts block that shows the link on the details page. Link events to places How to Link Two Custom Post Types? shows these settings with screenshots. Show the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[213,423],"class_list":["post-2684","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-extensions-features","gd_placecategory-custom-post-types-extension"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2684"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2684\/revisions"}],"predecessor-version":[{"id":2826,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2684\/revisions\/2826"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2684"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2684"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}