How to use Gravity form with the Geodirectory?

The Geodirectory plugin is an awesome way to create a Directory website in WordPress. So far Geodirectory only supports and recommends Ninja form to allow creating a contact listing form.
I have seen many people ask this question about the Gravity form integration with Geodirectory. I have no proper information over the internet about it. so here we will discuss How you can use Gravity form with the Geodirectory?

I have divided this integration into 5 steps. By following these 5 steps you can create a Contact Listing form using Gravity form to easily contact the Listing author.

Step 1 – Create a Dynamically Populated email tag

Gravity form supports Dynamic Population. we will use this feature to create a dynamic tag for the Listing Author email.
I have already prepared a snippet for you. you can use the code snippet plugin to use it OR if you have a child theme you can add this code to your child-themes functions.php.

/**
 * This code will help you to send email to the listing author email address. 
 */
add_filter( 'gform_field_value_author_email', 'populate_post_author_email' );
function populate_post_author_email( $value ) {
	global $post;
	$author_email = get_the_author_meta( 'email', $post->post_author );
	return $author_email;
}

If you want the contact listing email should go to the email address added in the Listing email field. You can use the code below.

/**
 * This code will help you to send email directly to the email address added for contact in the listing.
 */
add_filter( 'gform_field_value_author_email', 'populate_post_author_email' );
function populate_post_author_email( $value ) {
	global $gd_post;
	$email_to = is_email( $gd_post->email ) ? $gd_post->email : '';
	return $email_to;
}

Now that our Dynamically populated tag is ready. we can move to step 2.

Step 2 – Create a Gravity form for Geodirectory Contact Listing

Now you have to create a simple Gravity form for contacting a Listing.

Follow these mini steps to configure the dynamically created tag in the form.

1. Create a hidden field in the form

2. Click on the field setting

3. Enable allow the field to be populated dynamically

4. Add parameter Name to author_email as we have created in the above snippet.

Step 3 – Set Notification for Listing the Author

Now the last step is to allow the form submission notification to be enabled for the listing of the author.

You can look for the hidden field name in the field tags and use it inside the send to the email field.

Now your Gravity form is ready to work like a contact listing form with Geodirectory.

You can ask in the comment section if you have any queries.

Related Post

Top 5 Best WordPress Contact Form 7 Addon Plugins

Contact Form 7 is one of the most widely used form builder plugins for WordPress. However, its core functionality can be limited for users who need advanced features. Fortunately, there are several addons available that can enhance its capabilities, making form creation easier, more powerful, and more user-friendly. In this article, we’ll explore the Top

Read More »
Uncategorized

Top 5 Free WordPress Page Builders for Your Website

Building a website has never been easier, thanks to the powerful page builders available for WordPress. Whether you’re an experienced developer or a beginner, these free page builders can help you design and present your content with ease. In this post, we’ll explore the top five best free WordPress page builders to enhance your website’s

Read More »
Uncategorized

Top 5 Free Elementor Themes in WordPress

Creating stunning and responsive websites is easier than ever with Elementor, especially when paired with the right theme. In this post, we’ll dive into the top five free Elementor themes for WordPress, perfect for building everything from personal blogs to online stores. 1. Astra Astra is a popular theme renowned for its speed and flexibility.

Read More »

Start a Project with Us

Ready to dive into your next WordPress project? Reach out to us today for a chat, and let’s team up to make your digital dreams a reality!

People Who Worked With Us

Stay Updated with the Latest WordPress Tips & Tricks!

Subscribe to our newsletter and receive expert advice, tutorials, and updates on WordPress development, directory sites, and community-building tools. Get the insights you need to grow your website and business—straight to your inbox!