简体   繁体   English

Wordpress 自定义联系表,不确定从哪里开始

[英]Wordpress custom contact form, not sure where to start

Alright, so.好吧,所以。 I've tried many different methods, as well as looked at several videos on this subject.我尝试了许多不同的方法,并观看了有关此主题的几个视频。 But, i'm not making any progress.但是,我没有取得任何进展。 I have no idea where I am supposed to begin w/ this.我不知道我应该从哪里开始。

I created my own template for my portfolio.我为我的投资组合创建了自己的模板。 W/ its own custom form.带有自己的自定义表单。 And I want to recieve the messages put into this form and send them to my email.我想接收放入此表单的消息并将它们发送到我的电子邮件。

So far, none of the methods I have tried on my own have worked.到目前为止,我自己尝试过的方法都没有奏效。 Below, is the form itself.下面是表格本身。 Any help is appreciated.任何帮助表示赞赏。

<!-- searchform.php -->

<form class="contact-form" action="<?php the_permalink(); ?>" method="post">

    <!-- form row 1 -->
    <input class="form" type="text" placeholder="Name" value="<?php echo get_search_query(); ?>" name="name" required>

    <!-- form row 2 -->
    <input class="form" type="email" placeholder="Email" value="<?php echo get_search_query(); ?>" name="email" required>

    <!-- form row 3 -->
    <input class="form" type="text" placeholder="Title" value="<?php echo get_search_query(); ?>" name="title" required>
    
    <!-- form row 4 -->
    <textarea class="form" placeholder="Your Message" name="message" required></textarea>

    <!-- form row 5 -->
    <input class="form-button" type="submit" name="submit">

</form>

It does depend on which theme builder you're using (Elementor, Avada, Divi, etc.) because each of them come in-built with their own form which is highly customisable and will likely contain all the options you're looking for.它确实取决于您使用的主题构建器(Elementor、Avada、Divi 等),因为它们中的每一个都内置了自己的高度可定制的表单,并且可能包含您正在寻找的所有选项。

But I think it might be best to use a plugin for forms because I've found when trying to custom-code things Wordpress tends to have issues with that in unexpected places.但我认为最好为表单使用插件,因为我发现在尝试自定义代码时,Wordpress 在意想不到的地方往往会遇到问题。 The plugin I use when not the theme builder's, is Contact Form 7 .我在不是主题构建器时使用的插件是Contact Form 7 It gives the fewest issues and allows you a fair amount of customisation.它提供的问题最少,并允许您进行大量自定义。 Whatever you can't style in the form itself can always be done in the custom CSS section.无论您不能在表单本身中设置样式,都可以在自定义 CSS 部分中完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM