如何在我自己的HTML中使用Wordpress Contact Form 7? [英] How to use Wordpress Contact Form 7 in my own HTML?

查看:214
本文介绍了如何在我自己的HTML中使用Wordpress Contact Form 7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上使用Wordpress Contact Form 7,但我已经有了HTML / CSS布局。所以,我想修改插件以使用该自定义HTML代码。

I want to use Wordpress Contact Form 7 on my website, but I already have an HTML/CSS layout for it. So, I want to modify the plugin to use it with that custom HTML code.

<form id="contact_form" action="" method="post">                            
    <div>
        <label for="contact_name">Nombre</label>
        <input id="contact_name" type="text" required aria-required="true" placeholder="Nombre">
    </div>
    <div>
        <label for="contact_email">Email</label>
        <input id="contact_email" type="mail" name="email" required aria-required="true" placeholder="su@email.com">
    </div>  
    <div id="area_message">
        <label for="contact_message">Mensaje</label>
        <textarea id="contact_message" type="mail" required aria-required="true" placeholder="Mensaje"></textarea>
        <input id="contact_btn" type="submit" value="enviar">
    </div>
</form>

我的问题是:是否必须修改此代码,并附上一些联系表格7代码,或者是否应包含这到插件管理?

My question is: do I have to modify this code with some Contact Form 7 code or should I include this into the plugin administration?

推荐答案

不需要修改任何东西。联系表格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/

这篇关于如何在我自己的HTML中使用Wordpress Contact Form 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆