我在这里建了一个表格:http: //22twenty.com/wordpress/contact/
它从标准形式中获得了传统代码
<form id="contact" method="post" action="<?php bloginfo('template_directory'); ?> contact-send.php" class="validateform">
<div id="errormessage"></div>
<div id="sendmessage">
<p>Your message has been sent. Thank you!</p>
</div>
<div class="formfield">
<input name="name" type="text"placeholder="Name:" class="text" required/>
</div>
<div class="formfield">
<input name="email" type="email" placeholder="Email:" class="text" required/>
</div>
<div class="formfield">
<input name="subject" type="text" placeholder="Subject:" class="text" required/>
</div>
<div class="formfield">
<textarea name="message" class="text textarea" placeholder="Enter Your Message Here:" required></textarea>
</div>
<div class="formfield">
<input type="submit" id="send" value="Post message" class="btn" />
</div>
</form>
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "get_option('admin_email')";
$subject = $_POST['subject'];
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
?>
我想知道两件事这是添加表单的最佳方式,我可以在这个意义上使用 get_opition('admin_email') 吗?
谢谢
丹佛