且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在我自己的HTML中使用Wordpress Contact Form 7?

更新时间:2023-11-30 16:09:34

不需要修改任何东西。联系表格7支持开箱即用。您是否尝试过使用它或查看过文档?如果是这样,什么是或不是你的工作?

No need to modify anything. Contact Form 7 supports this out of the box. Have you tried using it or looked at the documentation yet? If so, what is or isn't working for you?

根据下面的评论更新

联系表格7为您提供了您生成的每个字段的简码。您可以在HTML中将简码封装在表格部分。使用您在问题中提供的示例,该示例如下所示:

Contact Form 7 gives you a shortcode for each field you generated. You can wrap the shortcode in HTML in the "Form" section. Using the example you provided in your question, that would look like this:

<div>
<label for="contact_name">Nombre</label>
[text* your-name 20/40 class:required "John Smith"]
</div>

您不需要将它包装在< form> 标签 - 联系表单7已经完成了这项工作(并分配了一个ID)。

You don't need to wrap this in a <form> tags - Contact Form 7 does that already (and assigns an ID).

在您的WordPress文本编辑器中,使用顶部提供的表单联系表7界面显示您的最终输出。如果您希望将它放在PHP模板中,请使用以下代码:

In your WordPress text editor, use the form shortcode provided at the top of the Contact Form 7 interface to display your final output. If you'd prefer to put this in a PHP template, use this:

<?php echo do_shortcode("SHORTCODE GOES HERE"); ?>

联系表格7还有一个邮件区域,您可以在其中确定邮件的目的地址,来自。某些托管服务提供商(例如Dream Host)要求FROM电子邮件与网站本身具有相同的域名( http:/ / /example.com 需要从hello@example.com或类似的地址发送电子邮件)。为了确保你仍然可以回复正确的地址,你可以添加一个回复标题,如下所示:

Contact Form 7 also has a section for mail, where you would identify who the mail should go to and come from. Some hosting providers (Dream Host, for example), require the FROM email to be the same domain as the site itself (a form on http://example.com would need to send emails from hello@example.com, or a similar address). To make sure you can still reply to the right address, you would add a replyto header like this:

Reply-To: [email]

只需将 [email] 更改为匹配您的电子邮件字段输出的简码。

Only change [email] to match whatever the outputted shortcode for your email field was.

但是,严重的是,这些东西都是在联系表格7的文档中: http://contactform7.com/docs/

But seriously, this stuff is ALL in the documentation for Contact Form 7: http://contactform7.com/docs/