php - Contact Form Fields Are Displaying On The Site, But Data Not Being Pulled Through To Email -
so needed 2 new fields contact form, went contact.php in shortcodes folder of wordpress theme, , edited display on website. looks on site, when fill out form , submit it, default fields sent email address.
here website, , below code: http://sellhouseforcashorlando.com/contact/
// contact form add_shortcode('contact_form', 'theme_shortcode_contact_form'); function theme_shortcode_contact_form($atts, $content = null, $code) { extract(shortcode_atts(array( 'mail_to' => '', 'form_id' => false, 'button_color' => 'black' ), $atts)); $id = mt_rand(0, 1000); $template_directory = get_template_directory_uri(); $ajax_url = admin_url('admin-ajax.php'); $mail_to = str_replace('@','[at]',$mail_to); $name_text = __('name', 'theme_front'); $email_text = __('email', 'theme_front'); $phonenumber_text = __('phone number', 'theme_front'); $address_text = __('property address', 'theme_front'); $message_text = __('message', 'theme_front'); $submit_text = __('submit', 'theme_front'); $form_id = ( $form_id ) ? '<input type="hidden" name="form-id" value="' . $form_id . '" />' : ''; return <<<ret [raw] <form method="post" action="$ajax_url" id="form-$id" class="contact-form ajax-form validate-form"> <div class="form-input-item clearfix"> <label for="contact-form-$id-contact-name">$name_text <span class="required-star">*</span></label> <input type="text" class="input-text" name="contact-name-h" id="contact-form-contact-name-h"> <input type="text" tabindex="8" size="22" value="" class="input-text {required:true}" name="contact-name" id="contact-form-$id-contact-name"> <div class="form-error-box"></div> </div> <div class="form-input-item clearfix"> <label for="contact-form-$id-contact-email">$email_text <span class="required-star">*</span></label> <input type="text" tabindex="9" size="22" value="" class="input-text {required:true, email:true}" name="contact-email" id="contact-form-$id-contact-email"> <div class="form-error-box"></div> </div> <div class="form-input-item clearfix"> <label for="contact-form-$id-contact-phonenumber">$phonenumber_text <span class="required-star">*</span></label> <input type="text" tabindex="9" size="22" value="" class="input-text {required:true}" name="contact-phonenumber" id="contact-form-$id-contact-phonenumber"> <div class="form-error-box"></div> </div> <div class="form-input-item clearfix"> <label for="contact-form-$id-contact-address">$address_text <span class="required-star">*</span></label> <input type="text" tabindex="9" size="22" value="" class="input-text {required:true}" name="contact-address" id="contact-form-$id-contact-address"> <div class="form-error-box"></div> </div> <div class="form-input-item clearfix"> <label for="contact-form-$id-contact-content">$message_text <span class="required-star">*</span></label> <textarea tabindex="10" rows="3" cols="30" class="input-textarea {required:true}" id="contact-form-$id-contact-content" name="contact-content"></textarea> <div class="form-error-box"></div> </div> <div class="form-response"></div> <div class="form-input-item form-input-item-last clearfix"> <button class="button medium $button_color" type="submit"><span>$submit_text</span></button> </div> $form_id <input type="hidden" name="mail_to" value="$mail_to"> <input type="hidden" name="action" value="do_contact" /> </form>
Comments
Post a Comment