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

Uncategorized

Best WordPress Page Builder Plugins Compared

1. Elementor Elementor is one of the most popular and powerful page builders for WordPress. It offers a real-time visual editor with a user-friendly interface that allows you to create responsive designs with ease.Key Features: Elementor is ideal for beginners and professionals looking for a feature-rich and intuitive page builder. 2. Divi Builder Divi Builder by Elegant Themes is a premium

Read More »
Uncategorized

Top 10+ Earning Online Business Directory Niches

In today’s digital world, online business directories have become a lucrative source of revenue. They help businesses connect with customers while generating income through paid listings, advertisements, and affiliate marketing. If you’re planning to start an online directory, choosing the right niche is essential for success. Here are the top 10+ earning online business directory niches that can help

Read More »
Uncategorized

Top 5 Best WordPress WooCommerce Themes

Choosing the right WooCommerce theme is crucial for building a professional and high-performing online store. A great theme enhances user experience, boosts sales, and ensures smooth functionality. In this blog, we’ll explore the top 5 best WooCommerce themes to help you find the perfect fit for your eCommerce business. 1. Astra Astra is a lightweight,

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!