{"id":2514,"date":"2026-10-20T08:34:11","date_gmt":"2026-10-20T07:34:11","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/add-contact-button-to-listings\/"},"modified":"2026-10-20T08:39:59","modified_gmt":"2026-10-20T07:39:59","slug":"add-contact-button-to-listings","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/add-contact-button-to-listings\/","title":{"rendered":"How to add a contact button to each listing in search results"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can put a contact button on every listing card on category, archive and search pages with the GD &gt; Ninja Forms block. Each button opens your contact form in a lightbox for that listing, so visitors can message a business without opening its page. The listing&#8217;s email address is not printed on the page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need the free Ninja Forms plugin and a contact form set up to send to the listing. Follow the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/integrations\/ninja-forms\/\">Ninja Forms integration guide<\/a> first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the button to the listing cards<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to GeoDirectory &gt; Settings &gt; General &gt; Pages and find Archive item page. This page is the template for each listing card.<\/li>\n\n\n\n<li>Edit that page.<\/li>\n\n\n\n<li>Add the GD &gt; Ninja Forms block where you want the button.<\/li>\n\n\n\n<li>Select your form, set Text to something like &#8220;Contact&#8221; and choose Button as the output type.<\/li>\n\n\n\n<li>Turn on Post Contact form. The button then only shows on listings that have an email address.<\/li>\n\n\n\n<li>Update the page.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you use shortcodes, this does the same. Replace 1 with your form ID:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_ninja_forms form_id=&quot;1&quot; text=&quot;Contact&quot; post_contact=&quot;1&quot; output=&quot;button&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The button settings are explained in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-ninja-forms\/\">GD &gt; Ninja Forms<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can put a contact button on every listing card on category, archive and search pages with the GD &gt; Ninja Forms block. Each button opens your contact form in a lightbox for that listing, so visitors can message a business without opening its page. The listing&#8217;s email address is not printed on the page. [&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-2514","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\/2514","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=2514"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2514\/revisions"}],"predecessor-version":[{"id":2622,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2514\/revisions\/2622"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2514"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2514"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}