admin管理员组文章数量:1332361
I am trying to learn how to build contact form from scratch without plugin. I came across this tutorial
I am not understanding why we need to put contact form code inside the loop as shown in the tutorial. Out of curiousity I tried putting my code within page-contact.php without using the loop and it was rendered out correctly. I didn't start implementing php code yet. I checked Codex about the_post and the_content tags and what they do within the loop. Say the_content pulls in from database the content of the page or post. So why my markup works without the loop and those tags?
my current page-contact.php
<?php get_header();?>
<main>
<form method="GET" action="form.html" class="contact">
<div class="field-wrap">
<div>
<input type="text" name="name" id="name" required/>
<label for="name">Name</label>
</div>
<div>
<input type="text" name="email" id="email" required/>
<label for="email">Email</label>
</div>
</div>
<div class="message">
<textarea name="message" id="message" cols="30" rows="25" required></textarea>
<label for="message">Message</label>
</div>
<button>Submit</button>
</form>
</main>
<?php get_footer();?>
本文标签: contact form and WP loop
版权声明:本文标题:contact form and WP loop 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742319292a2452453.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论