Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $impress;
- if(isset($_POST['submit']))
- {
- if( !$_POST['name'] || !$_POST['email'] || !$_POST['comment'] || $_POST['name'] == '' || $_POST['email'] == ''|| $_POST['comment'] == '')
- {
- $error = 'Please fill in all the required fields';
- }
- else
- {
- require('../../../wp-load.php');
- $impress = get_option('impress');
- $name = esc_html($_POST['name']);
- $email = esc_html($_POST['email']);
- $comment = esc_html($_POST['comment']);
- $msg = esc_attr('Name: ', 'impress') . $name . PHP_EOL;
- $msg .= esc_attr('E-mail: ', 'impress') . $email . PHP_EOL;
- $msg .= esc_attr('Message: ', 'impress') . $comment;
- $to = $impress['email'];
- $sitename = is_multisite() ? $current_site->site_name : get_bloginfo('name');
- $subject = '[' . $sitename . ']' . ' New Message';
- $headers = 'From: ' . $name . ' <' . $email . '>' . PHP_EOL;
- wp_mail($to, $subject, $msg, $headers);
- }
- }
- get_header(); ?>
- <?php
- if ( ( $locations = get_nav_menu_locations() ) && $locations['top-menu'] ) {
- $menu = wp_get_nav_menu_object( $locations['top-menu'] );
- $menu_items = wp_get_nav_menu_items($menu->term_id);
- $include = array();
- foreach($menu_items as $item) {
- if($item->object == 'page')
- $include[] = $item->object_id;
- }
- query_posts( array( 'post_type' => 'page', 'post__in' => $include, 'posts_per_page' => count($include), 'orderby' => 'post__in' ) );
- }
- else
- {
- if(isset($impress['pages_topmenu']) && $impress['pages_topmenu'] != '' )
- query_posts(array( 'post_type' => 'page', 'post__in' => $impress['pages_topmenu'], 'posts_per_page' => count($impress['pages_topmenu']), 'orderby' => 'menu_order', 'order' => 'ASC' ) );
- else
- query_posts(array( 'post_type' => 'page', 'posts_per_page' => 4, 'orderby' => 'menu_order', 'order' => 'ASC' ) );
- }
- $i = 1;
- while(have_posts() ) : the_post(); ?>
- <?php $temp = get_post_meta($post->ID, 'vp_settings', true);?>
- <div <?php if($i == 1) echo 'style="margin-top: -65px"';?> class="bg" id="<?php echo $post->post_name;?>"
- <?php if(isset($temp['variation']) && $temp['variation'] == 2) { echo 'style="';
- if(isset($temp['background_color']) && $temp['background_color'] != '') echo 'background-color: #' . $temp['background_color'];
- else if(isset($temp['background']) && $temp['background'] != '') echo 'background-image: url(\'' . $temp['background'] . '\')'; echo '"'; } ?>>
- <div class="container">
- <div class="sixteen columns">
- <div class="bar" <?php if($i==1) echo 'style="margin-top: 110px"';?>>
- <h2>
- <?php $icon = get_post_meta($post->ID, 'icon', true);
- if($icon != '') echo '<img src="' . esc_attr($icon) . '" />'; ?>
- <?php $top_title = get_post_meta($post->ID, 'top_title', true);
- if($top_title != '') echo $top_title; else the_title();?>
- </h2>
- </div>
- <?php $description = get_post_meta($post->ID, 'description', true);
- if($description != '') { ?>
- <p class="sub">
- <?php echo $description; ?>
- </p>
- <?php } ?>
- </div> <!-- end sixteen columns -->
- <div class="clear"></div>
- <?php global $more; $more = 0; the_content('');?>
- </div> <!-- end container -->
- </div> <!-- end bg -->
- <?php $i++; endwhile; wp_reset_query(); ?>
- <div id="contact">
- <div class="container">
- <div class="sixteen columns">
- <h2><span class="bar"></span><span class="icn_contact"></span><?php _e('Contact', 'Impress');?><span class="bar"></span></h2>
- <?php if($impress['google_maps'] != '')
- echo $impress['google_maps'];
- else { ?>
- <iframe class="map" width="924" height="208" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&t=m&ll=40.761512,-73.971827&spn=0.003381,0.017231&z=16&output=embed"></iframe>
- <?php } ?>
- </div> <!-- end sixteen columns -->
- <div class="ten columns">
- <div class="contact_form">
- <div class="done">
- <?php _e('<b>Thank you!</b> I have received your message.', 'Impress');?>
- </div>
- <form method="post">
- <p><?php _e('name', 'Impress');?></p>
- <input type="text" name="name" class="text" />
- <p><?php _e('email', 'Impress');?></p>
- <input type="text" name="email" class="text" id="email" />
- <p><?php _e('message', 'Impress');?></p>
- <textarea name="comment" class="text textarea"></textarea>
- <input type="submit" id="submit" value="<?php _e('send', 'Impress');?>" class="submit-button" />
- </form>
- </div> <!-- contact form -->
- </div> <!-- end ten columns -->
- <div class="six columns">
- <div class="contact_info">
- <h4>Contact info</h4>
- <?php if(isset($impress['phone']) && $impress['phone'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_phone.png'?>" alt="" /> <?php echo $impress['phone'];?> </p> <?php } ?>
- <?php if(isset($impress['email']) && $impress['email'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_mail.png'?>" alt="" /> <?php echo encEmail($impress['email']);?></p> <?php } ?>
- <?php if(isset($impress['location']) && $impress['location'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_address.png'?>" alt="" /> <?php echo $impress['location'];?></p> <?php } ?>
- </div> <!-- end contact_info -->
- </div> <!-- end seven columns -->
- </div> <!-- end container -->
- </div> <!-- end about -->
- <footer>
- <div class="pixels">
- <p class="pixels_notif"><?php _e('P.S - You\'ve scrolled <span id="pixels">0</span> Pixels!', 'Impress');?></p>
- </div>
- <div class="copyright">
- <p><?php _e('© 2012', 'Impress'); echo bloginfo('name'); _e('All rights reserved.', 'Impress'); _e('Powered by ', 'Impress'); ?>
- <a href="http://wordpress.org">WordPress</a>,
- <?php _e('developed by ', 'Impress');?>
- <a href="http://teothemes.com">TeoThemes</a>
- </p>
- </div>
- </footer>
- </div> <!-- end container -->
- </div> <!-- end contact -->
- <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement