• Resolved gerzenstl

    (@gerzenstl)


    Hi Greg,

    I’m looking for a way to override the contact form. I found that adext_contact_form function is the one that renders the template I need to change it.

    This function is called by the action adverts_tpl_single_bottom. Is there a way that I could override this to set my custom markup?

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    sure, this is possible, you can add the code below in your theme functions.php file to deactivate the default contact form and display your own

    
    add_filter( "wp", "custom_contact_form_init", 50 );
    function custom_contact_form_init() {
      remove_action( 'adverts_tpl_single_bottom', 'adverts_single_contact_information' );
      remove_action( 'adverts_tpl_single_bottom', 'adext_contact_form' );
      remove_action( 'adverts_tpl_single_bottom', 'adext_bp_send_private_message_button', 50 );
    
      add_action( 'adverts_tpl_single_bottom', "custom_contact_from", 5 );
    }
    function custom_contact_from( $post_id ) {
      echo "Print Custom Contact Form Here";
    }
    

    Just customize the custom_contact_from() function above to display the contact form you want to show.

    Thread Starter gerzenstl

    (@gerzenstl)

    Hi Greg, sorry for my late response.

    That worked very well!

    Thanks!

    • This reply was modified 4 years, 4 months ago by gerzenstl.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Override Contact form’ is closed to new replies.