You can put a contact button on every listing card on category, archive and search pages with the GD > 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’s email address is not printed on the page.
You need the free Ninja Forms plugin and a contact form set up to send to the listing. Follow the Ninja Forms integration guide first.
Add the button to the listing cards
- Go to GeoDirectory > Settings > General > Pages and find Archive item page. This page is the template for each listing card.
- Edit that page.
- Add the GD > Ninja Forms block where you want the button.
- Select your form, set Text to something like “Contact” and choose Button as the output type.
- Turn on Post Contact form. The button then only shows on listings that have an email address.
- Update the page.
If you use shortcodes, this does the same. Replace 1 with your form ID:
[gd_ninja_forms form_id="1" text="Contact" post_contact="1" output="button"]
The button settings are explained in GD > Ninja Forms.