I'm a bit new to custom wordpress pages and I purchased a HTML theme that I successfully converted into a Wordpress site. The thing is, that there is a contact form that I would like to use and I've followed the codex instructions on using admin-post.php file but the form is not getting submitted.
Below is the form in my footer.php:
<form id="contact-form" method="POST" action="http://tvans.gr/wp-admin/admin-post.php">
<input type="hidden" name="action" value="send_form"/>
<input type="hidden" name="custom_nonce" value="<?php echo $custom_form_nonce ?>"/>
<input class="form-control form-text" id="name" type="text" name="name" value="" placeholder="Please Enter Name" required />
<input class="form-control form-text" id="email" type="email" name="email" value="" placeholder="Please Enter Email" required />
<textarea class="form-control form-text" id="message" name="message" placeholder="Message" rows="4" required></textarea>
<input type="submit" class="btn-1" id="submit" name="submit" value="SUBMIT">
<input type="reset" class="btn-1 distab-cell-middle cancel" name="clear" value="RESET">
</form>
And here is my functions.php file:
function prefix_admin_send_form(){
echo $_POST['name'];
print($_POST['email']);
exit;
}
add_action('admin_post_send_form', 'prefix_admin_send_form');
The data in functions.php is for testing purposes but still I'm not getting any response. Is it something I did wrong here or is is something that I'm missing? Thanks in advance for any help.