Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //Template Name: Contact Page
- get_header();
- get_template_part('weblizar','breadcrumbs');
- $wl_theme_options = chronicle_contact_options(); ?>
- <div class="clearfix margin_top3"></div>
- <div class="container">
- <div class="content_fullwidth lessmar">
- <div class="one_half">
- <?php the_post();
- the_content();?>
- <br /><br />
- <div class="cforms">
- <form action="#" method="POST" id="weblizar_form" class="sky-form">
- <header><?php _e('Contact','weblizar') ;?> <strong><?php _e('Form','weblizar') ;?></strong></header>
- <fieldset>
- <div class="row">
- <section class="col col-6">
- <label class="label"><?php _e('Name','weblizar');?></label>
- <label class="input"> <i class="icon-append icon-user"></i>
- <input type="text" name="user_name" id="user_name">
- </label>
- <span id="contact_name_error" style="display:none;"><?php _e('Fill your name','weblizar'); ?></span>
- </section>
- <section class="col col-6">
- <label class="label"><?php _e('E-mail','weblizar');?></label>
- <label class="input"> <i class="icon-append icon-envelope-alt"></i>
- <input type="email" name="user_email" id="user_email">
- </label>
- <span id="contact_email_error" style="display:none;"><?php _e('Fill your Email','weblizar'); ?></span>
- </section>
- </div>
- <section>
- <label class="label"><?php _e('Subject','weblizar');?></label>
- <label class="input"> <i class="icon-append icon-tag"></i>
- <input type="text" name="subject" id="subject">
- </label>
- </section>
- <section>
- <label class="label"><?php _e('Message','weblizar');?></label>
- <label class="textarea"> <i class="icon-append icon-comment"></i>
- <textarea rows="4" name="user_message" id="user_message"></textarea>
- </label>
- <span id="contact_user_massage_error" style="display:none;"><?php _e('Fill your Text massage','weblizar'); ?></span>
- </section>
- <section>
- <input type="checkbox" name="data_protection" value="data_protection" required> consent to processing the personal data <br>
- </section>
- </fieldset>
- <footer>
- <button name="query_submit" id="query_submit" type="submit" class="button"><?php _e('Send message','weblizar');?></button>
- </footer>
- </form>
- <div id="enquiry_send_massage" class="message" style="display:none;">
- <p><?php _e('Your message was successfully sent!','weblizar');?></p>
- </div>
- </div>
- </div>
- <?php if(isset($_POST['query_submit']))
- { if($_POST['user_name']==''){
- echo "<script>jQuery('#contact_name_error').show();</script>";
- } else
- if($_POST['user_email']=='') {
- echo "<script>jQuery('#contact_email_error').show();</script>";
- } else
- if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $_POST['user_email'])) {
- echo "<script>jQuery('#contact_email_error').show();</script>";
- } else
- if($_POST['user_message'] ==''){
- echo "<script>jQuery('#contact_user_massage_error').show();</script>";
- }
- else
- { $email = get_option('admin_email');
- $subject = "You have new enquiry form".get_option("blogname");
- $massage = stripslashes(trim($_POST['user_message']))."<br>Message sent from <br> Name:" . trim($_POST['user_name']). "<br>Email :". trim($_POST['user_email']);
- $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);
- add_filter( 'wp_mail_content_type', 'wl_html_content_type' );
- function wl_html_content_type() {
- return 'text/html';
- }
- $enquerysend =wp_mail( $email, $subject, $massage, $headers);
- echo "<script>jQuery('#weblizar_form').hide();</script>";
- echo "<script>jQuery('#enquiry_send_massage').show();</script>";
- }
- }
- ?>
- <div class="one_half last">
- <div class="address_info">
- <?php if($wl_theme_options['contact_heading'] !='') { ?>
- <h4><?php echo $wl_theme_options['contact_heading']; ?></h4>
- <?php } ?>
- <ul>
- <li><?php
- if($wl_theme_options['contact_address_text'] !='') {
- echo $wl_theme_options['contact_address_text']; ?> <br />
- <?php }
- if($wl_theme_options['contact_address'] !='') {
- echo $wl_theme_options['contact_address']; ?><br />
- <?php }
- if($wl_theme_options['contact_phone_no'] !='') {
- echo $wl_theme_options['phone_number_text']; ?>: <?php echo $wl_theme_options['contact_phone_no']; ?><br />
- <?php
- }
- if($wl_theme_options['fax_number'] !='') {
- echo $wl_theme_options['fax_number_text']; ?>: <?php echo $wl_theme_options['fax_number']; ?><br />
- <?php
- }
- if($wl_theme_options['contact_email'] !='') {
- echo $wl_theme_options['contact_email_text']; ?>: <a href="mailto:<?php echo $wl_theme_options['contact_email']; ?>"><?php echo $wl_theme_options['contact_email']; ?></a><br />
- <?php
- }
- if($wl_theme_options['website_address'] !='') {
- echo $wl_theme_options['website_address_text']; ?>: <a href="<?php echo $wl_theme_options['website_address']; ?>"><?php echo $wl_theme_options['website_address']; ?></a>
- <?php } ?>
- </li>
- </ul>
- </div>
- <div class="clearfix"></div>
- <?php if($wl_theme_options['google_map_on_contact'] =='on' ) { ?>
- <h4><?php _e('Find the','weblizar') ;?> <strong><?php _e('Address','weblizar') ;?></strong></h4>
- <?php if($wl_theme_options['google_maps'] !='') { ?>
- <iframe src="<?php echo $wl_theme_options['google_maps']; ?>" width="100%" scrolling="no" height="500" frameborder="0" marginheight="0" marginwidth="0"></iframe>
- <?php } ?>
- <br />
- <?php } ?>
- </div>
- </div>
- </div><!-- end content area -->
- <div class="margin_top5"></div>
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment