Adding a custom modal to replace 'Reply to Listing'

I’m using the ExpertHive theme, and I would like to change the behavior of the “Reply to Listing” button on Listing pages.

Currently, when a site visitor is not logged in and they click the “Reply to Listing” button, the visitor will see a user_login_modal

I would like to replace the user_login_modal with a custom modal. The modal will contain a form/fields and non-logged in site visitors will be allowed to see/submit the form. This could include using a 3rd party form via shortcode or tbd.

Before I get started, I’m just looking for general advice and pointers from anyone familiar with HivePress, ExpertHive, or similar setups:

  • What would you suggest I look into for overriding or replacing that modal behavior?
  • Are there specific hooks, templates, or parts of the theme I should pay attention to?
  • Anything else you’d recommend thinking about early on to make this a smooth customization?

I found these pages on modal Modal | Developer Docs and HivePress Code Reference but I’m still trying to get a feel for the best approach overall.

Appreciate any insights

Hi,

If you are referring to listings, you can overwrite these template parts using a child theme https://help.hivepress.io/article/143-how-to-create-a-child-theme:

There, you can replace the user_login_modal link with any link you need, for example, to a page with a contact form or a modal if you make one, and there in the modal window, you will have to create a custom form that does not require a login but prefills the listing author to whom the form is sent (or if it should be sent to the admin, then any form with a shortcode will do).

​I hope this is helpful to you

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.