-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcontact.php
More file actions
92 lines (87 loc) · 3.38 KB
/
contact.php
File metadata and controls
92 lines (87 loc) · 3.38 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
//Template Name: Contact Page
get_header() ?>
<div class="container">
<header class="title">
<h2><?php the_title() ?></h2>
</header>
<?php while ( have_posts() ) : the_post(); ?>
<div class="post">
<article>
<?php the_content() ?>
</article>
<div class="social-links">
<a href="http://facebook.com/<?php echo get_option('fb_id'); ?>" class="facebook">
<i class="icon-facebook"></i>
</a>
<a href="http://twitter.com/<?php echo get_option('twitter_id'); ?>" class="twitter">
<i class="icon-twitter"></i>
</a>
<a href="http://plus.google.com/<?php echo get_option('gplus_id'); ?>" class="google">
<i class="icon-google-plus"></i>
</a>
<a href="<?php echo get_option('linkedin_id'); ?>" class="linkedin">
<i class="icon-linkedin"></i>
</a>
</div>
<div class="contact-form">
<article style="display: none" id="sent-message">
<h2><?php echo __( 'Thank you, your message successfully sent', 'tiny_theme') ?></h2>
<p><?php echo __( 'Our inboxes are 24/7 ready to hear from you, if you want to ask a question or request a service just fill this 2 minutes form below which may help your life and giving you the ability to bring your vision into public just as you imagined.', 'tiny_theme') ?></p>
</article>
<article style="display: none" id="error-message">
<h2><?php echo __( 'Oops, your message wasn\'t sent', 'tiny_theme') ?></h2>
<p><?php echo __( 'Our inboxes are 24/7 ready to hear from you, if you want to ask a question or request a service just fill this 2 minutes form below which may help your life and giving you the ability to bring your vision into public just as you imagined.', 'tiny_theme') ?></p>
</article>
<form id="ajaxContact">
<div>
<label><?php echo __( 'Your Name', 'tiny_theme') ?></label>
<input name="name" type="text" placeholder="Full Name" required/>
</div>
<div>
<label><?php echo __( 'E-mail', 'tiny_theme') ?></label>
<input name="email" type="email" placeholder="Email address" required/>
</div>
<div>
<label><?php echo __( 'Subject', 'tiny_theme') ?></label>
<input name="subject" type="text" placeholder="Message Subject" required/>
</div>
<textarea name="message"></textarea>
<input type="hidden" name="contact_email" value="<?php print get_option('contact_email')?>"/>
<input type="submit" class="submit" value="Post" />
</form>
</div>
<?php endwhile; ?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#ajaxContact").validate();
$('#ajaxContact').submit(function() {
if ($("#ajaxContact").valid() == false){
return false;
}
// got event!!
$("#ajaxContact").fadeTo("slow", 0.33);
//-------------------
$.ajax({
type: "POST",
url: "<?php echo get_template_directory_uri() ?>/mailsend.php",
data: $(this).serialize(),
success: function(data) {
if (data == "true"){
// msg sent...
$("#ajaxContact").slideUp();
$("#sent-message").slideDown();
}else{
// cannot sent msg
$("#ajaxContact").slideUp();
$("#error-message").slideDown();
}
},
});
return false;
});
});
</script>
<?php get_footer() ?>