{"id":2473,"date":"2026-10-20T08:33:27","date_gmt":"2026-10-20T07:33:27","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/show-listing-content-by-post-id\/"},"modified":"2026-10-20T08:57:18","modified_gmt":"2026-10-20T07:57:18","slug":"show-listing-content-by-post-id","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/show-listing-content-by-post-id\/","title":{"rendered":"How to show a listing&#8217;s description or fields by post ID"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Use the GD &gt; Post Content block or shortcode with the listing&#8217;s ID. It shows that listing&#8217;s description (the post content) on any page, not only on the listing itself.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_post_content id=&quot;123&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace 123 with the listing ID. You can find it in the address bar when editing the listing (<code>post=123<\/code>). To shorten it, add a word limit, for example <code>limit=&quot;40&quot;<\/code>, which also strips HTML.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Show any other field<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">GD &gt; Post Meta takes the same <code>id<\/code> option and works with any field key, including custom fields. Add <code>show=&quot;value&quot;<\/code> to drop the icon and label.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_post_meta id=&quot;123&quot; key=&quot;phone&quot; show=&quot;value&quot;&#093;\n&#091;gd_post_meta id=&quot;123&quot; key=&quot;post_content&quot; show=&quot;value&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-post-content\/\">GD &gt; Post Content<\/a> and <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-post-meta\/\">GD &gt; Post Meta<\/a> for all options.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">In PHP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The description is the normal WordPress post content, and GeoDirectory fields can be read with <code>geodir_get_post_meta()<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">$post_id = 123;\n\n\/\/ Description, with the usual WordPress formatting.\necho apply_filters( &#039;the_content&#039;, get_post_field( &#039;post_content&#039;, $post_id ) );\n\n\/\/ Any GeoDirectory field, by its key.\necho esc_html( geodir_get_post_meta( $post_id, &#039;phone&#039;, true ) );<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Use the GD &gt; Post Content block or shortcode with the listing&#8217;s ID. It shows that listing&#8217;s description (the post content) on any page, not only on the listing itself. Replace 123 with the listing ID. You can find it in the address bar when editing the listing (post=123). To shorten it, add a word [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,432],"class_list":["post-2473","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2473","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=2473"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2473\/revisions"}],"predecessor-version":[{"id":2727,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2473\/revisions\/2727"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2473"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2473"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}