{"id":2521,"date":"2026-10-20T08:34:11","date_gmt":"2026-10-20T07:34:11","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/listing-description-read-more\/"},"modified":"2026-10-20T08:39:59","modified_gmt":"2026-10-20T07:39:59","slug":"listing-description-read-more","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/listing-description-read-more\/","title":{"rendered":"How to add a read more link to the listing description"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The GD &gt; Post Content block can cut a listing description down to a word limit or a height and add a read more link. The link opens the full listing, so it is meant for listing cards on archive and search pages. On the listing&#8217;s own page the link only points back to the same page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Shorten the description on listing cards<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add GD &gt; Post Content to your archive item template (GeoDirectory &gt; Settings &gt; General &gt; Pages &gt; Archive item page) and set:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Word limit: the number of words to show. Tags are stripped.<\/li>\n\n\n\n<li>Max height: a height in pixels. Longer text fades out at that height.<\/li>\n\n\n\n<li>Read more link: the link text. Enter <code>0<\/code> to hide the link.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The shortcode version looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_post_content key=&quot;post_content&quot; show=&quot;value&quot; max_height=&quot;120&quot; read_more=&quot;Read more...&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/gd-archive-item-change-the-length-of-the-text-shown-with-gd-loop-and-gd-listings\/\">how to change the length of the text shown<\/a> for more on listing card text.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Expand the description on the listing page<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There is no built-in toggle that expands the text in place on the details page. If you use GD &gt; Post Content with a Max height on your details template, this snippet makes the read more link open the rest of the description on the same page. Add it with the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_action( &#039;wp_footer&#039;, function () {\n\tif ( ! function_exists( &#039;geodir_is_page&#039; ) || ! geodir_is_page( &#039;single&#039; ) ) {\n\t\treturn;\n\t}\n\t?&gt;\n\t&lt;script&gt;\n\tdocument.addEventListener( &#039;click&#039;, function ( e ) {\n\t\tvar link = e.target.closest( &#039;.geodir-field-post_content .gd-read-more&#039; );\n\t\tif ( ! link ) {\n\t\t\treturn;\n\t\t}\n\t\te.preventDefault();\n\t\tlink.closest( &#039;.geodir-field-post_content&#039; ).style.maxHeight = &#039;none&#039;;\n\t\tlink.remove();\n\t} );\n\t&lt;\/script&gt;\n\t&lt;?php\n} );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">All the block settings are listed in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-post-content\/\">GD &gt; Post Content<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The GD &gt; Post Content block can cut a listing description down to a word limit or a height and add a read more link. The link opens the full listing, so it is meant for listing cards on archive and search pages. On the listing&#8217;s own page the link only points back to the [&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-2521","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\/2521","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=2521"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2521\/revisions"}],"predecessor-version":[{"id":2629,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2521\/revisions\/2629"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2521"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2521"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}