-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-contact.php
51 lines (45 loc) · 2.66 KB
/
template-contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Template Name: Template Contact
*/
// send contact
if (isset($_POST['contact'])) {
$error = ale_send_contact($_POST['contact']);
}
get_header();
?>
<!-- Content -->
<div class="contacts-center">
<div class="content">
<div class="h2" ><?php the_title(); ?></div>
<div class="contact-content">
<div class="left">
<div class="contacts">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<div class="right">
<form method="post" action="<?php the_permalink();?>">
<?php if (isset($_GET['success'])) : ?>
<p class="success"><?php _e('Thank you for your message!', 'aletheme')?></p>
<?php endif; ?>
<?php if (isset($error) && isset($error['msg'])) : ?>
<p class="error"><?php echo $error['msg']?></p>
<?php endif; ?>
<div class="form">
<input name="contact[name]" type="text" placeholder="Your Name (required)" value="<?php echo isset($_POST['contact']['name']) ? $_POST['contact']['name'] : ''?>" required="required" id="contact-form-name" />
<input name="contact[email]" type="email" placeholder="Email (required)" value="<?php echo isset($_POST['contact']['email']) ? $_POST['contact']['email'] : ''?>" required="required" id="contact-form-email" />
<input name="contact[phone]" type="text" placeholder="Phone (required)" value="<?php echo isset($_POST['contact']['phone']) ? $_POST['contact']['phone'] : ''?>" required="required" id="contact-form-phone" />
<input name="contact[genre]" type="text" placeholder="Genre (required)" value="<?php echo isset($_POST['contact']['genre']) ? $_POST['contact']['genre'] : ''?>" required="required" id="contact-form-genre" />
<textarea name="contact[message]" placeholder="Your Message (required)"id="contact-form-message" required="required"><?php echo isset($_POST['contact']['message']) ? $_POST['contact']['message'] : ''?></textarea>
<input type="submit" class="submit" value="<?php _e('Submit', 'aletheme')?>"/>
</div>
<?php wp_nonce_field() ?>
</form>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>