adding new demo template and ne buttons to front page
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 26 Jun 2018 16:46:26 +0000 (12:46 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 26 Jun 2018 16:46:26 +0000 (12:46 -0400)
demo-page.php [new file with mode: 0644]
functions.php
header.php
js/custom.js
style.css

diff --git a/demo-page.php b/demo-page.php
new file mode 100644 (file)
index 0000000..792af60
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Template Name: Demo Page
+ *
+ * @package accesspress_parallax
+ */
+
+get_header();
+
+       $sections = of_get_option('parallax_section');
+
+       if(!empty($sections)):
+       foreach ($sections as $section) :
+               $page = get_post( $section['page'] ); 
+               $overlay = $section['overlay'];
+               $image = $section['image'];
+               $layout = $section['layout'];
+               $category = $section['category']; 
+               $googlemapclass = $layout == "googlemap_template" ? " google-map" : "";
+       ?>
+
+       <?php if(!empty($section['page'])): ?>
+               <section class="parallax-section clearfix<?php echo esc_attr($googlemapclass)." ".esc_attr($layout);  ?>" id="<?php echo "section-".absint($page->ID); ?>">
+               <?php if(!empty($image) && $overlay!="overlay0") : ?>
+                       <div class="overlay"></div>
+               <?php endif; ?>
+
+               <?php if($layout != "googlemap_template") :?>
+                       <div class="mid-content">
+               <?php endif; ?>
+                       <?php  
+                   $query = new WP_Query( 'page_id='.$section['page'] );
+                   while ( $query->have_posts() ) : $query->the_post();
+               ?>
+                               <?php 
+                               if($layout != "action_template" && $layout != "blank_template" && $layout != "googlemap_template"): ?>
+                                       <h2><span><?php the_title(); ?></span></h2>
+
+                                       <div class="parallax-content">
+                                       <?php if(get_the_content() != "") : ?>
+                                               <div class="page-content">
+                                               <?php the_content(); ?>
+                                               </div>
+                                       <?php endif; ?>
+                                       </div> 
+                               <?php endif; ?>
+                       <?php 
+                       endwhile;    
+               ?>
+
+                                       <?php 
+                                               switch ($layout) {
+                                                       case 'default_template':
+                                                               $template = "layouts/default";
+                                                               break;
+
+                                                       case 'service_template':
+                                                               $template = "layouts/service";
+                                                               break;
+
+                                                       case 'team_template':
+                                                               $template = "layouts/team";
+                                                               break;
+
+                                                       case 'portfolio_template':
+                                                               $template = "layouts/portfolio";
+                                                               break;
+
+                                                       case 'testimonial_template':
+                                                               $template = "layouts/testimonial";
+                                                               break;
+
+                                                       case 'action_template':
+                                                               $template = "layouts/action";
+                                                               break;
+
+                                                       case 'blank_template':
+                                                               $template = "layouts/blank";
+                                                               break;
+
+                                                       case 'googlemap_template':
+                                                               $template = "layouts/googlemap";
+                                                               break;
+
+                                                       case 'blog_template':
+                                                               $template = "layouts/blog";
+                                                               break;
+                                                       
+                                                       default:
+                                                               $template = "layouts/default";
+                                                               break;
+                                               }
+                                       ?>
+
+                                       <?php include(locate_template($template."-section.php"));?>
+                       
+                       <?php if($layout != "googlemap_template") :?>
+                       </div>
+                       <?php endif; ?>
+               </section>
+       <?php
+       endif; 
+       endforeach;
+       endif;
+?>
+
+<?php get_footer();
\ No newline at end of file
index 7fe5acb..49adc7c 100644 (file)
@@ -66,6 +66,7 @@ function accesspress_parallax_setup() {
 
        // This theme uses wp_nav_menu() in one location.
        register_nav_menus( array(
+        'demo'      => __( 'Demo', 'accesspress-parallax' ),
         'primary'   => __( 'Primary Menu', 'accesspress-parallax' ),
         'login'     => __( 'Login Menu', 'accesspress-parallax' ),
         'logout'    => __( 'Logout Menu', 'accesspress-parallax' ),
index 9f0b743..403737a 100644 (file)
 <?php wp_head(); ?>
 </head>
 <script>
-    window.icon_url = '<?php echo get_template_directory_uri(); ?>';
+    window.icon_url     = '<?php echo get_template_directory_uri(); ?>';
+    window.contactForm  = '<?php echo get_permalink(112); ?>';
 </script>
-<body <?php body_class(); ?>>
+<?php 
+    global $post; 
+    $page = $post->post_title;
+?>
+<body <?php body_class(); ?> data-page="<?php echo strtolower($page); ?>">
 <div id="modal-login">
     <?php echo do_shortcode('[glm-login-form]'); ?>
     <a class="registration-link" href="<?php echo get_permalink(21); ?>"> Sign Up </a>
@@ -34,7 +39,7 @@
                <div class="mid-content clearfix">
         
         <div class="flex-box">
-               <div id="site-logo">
+               <div id="site-logo" class="logo-<?php echo $page; ?>">
                <?php if ( get_header_image() ) : ?>
                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
                        <img src="<?php header_image(); ?>" alt="<?php bloginfo( 'name' ); ?>">
                                'container'      => false
             ) ); 
 
-            wp_nav_menu( array( 
-                               'theme_location' => 'primary' , 
-                               'container'      => false
-                       ) );
+            
                        $sections = of_get_option('parallax_section');
                        if((of_get_option('enable_parallax') == 1 && of_get_option('enable_parallax_nav') == 1) || (is_page_template('home-page.php') && of_get_option('enable_parallax_nav') == 1)):
                        ?>
                        </ul>
             <?php      
             
-                       else: 
+            else: 
+            
+                if($page === 'Demo'){
+                    wp_nav_menu( array( 
+                        'theme_location' => 'demo' , 
+                        'container'      => false
+                    ) );
+                }else {
+                    wp_nav_menu( array( 
+                        'theme_location' => 'primary' , 
+                        'container'      => false
+                    ) );
+                }
                                
                        endif; ?>
                
index cecad74..21b80b9 100644 (file)
@@ -182,4 +182,12 @@ jQuery(document).ready(function($){
     login_section.on("click", function(){
         $("#modal-login").toggleClass("show-login");
     })
+
+    getting_started.append( $('<div />',{
+        class: 'contact-form',
+        text: `Invite Superior Hospitality Partners to your community to see if Hospitality Mentality 360 will be beneficial for you and your visitors.`
+    }))
+    $(".contact-form").on("click", function(){
+        window.location = window.contactForm;
+    })
 });
\ No newline at end of file
index b60f79a..9053c70 100644 (file)
--- a/style.css
+++ b/style.css
@@ -2514,6 +2514,7 @@ div.cmvl-courses-list-shortcode table tbody tr{
 div.cmvl-courses-list-shortcode table thead tr th{
    display: none;
 }
+
 div.cmvl-courses-list-shortcode table tbody tr{
    width: 45%;
    display:block;
@@ -2527,6 +2528,11 @@ div.cmvl-courses-list-shortcode table tbody tr{
    transition: box-shadow .2s ease-in-out, background-color .2s ease-in-out;
    box-shadow: 5px 5px 25px 0 rgba(46,61,73,.2);
 }
+@media (max-width: 640px){
+    div.cmvl-courses-list-shortcode table tbody tr{
+        margin: 10px 0px;
+    }
+}
 div.cmvl-courses-list-shortcode table tbody tr td{
    /* text-align: center; */
 }
@@ -2672,4 +2678,24 @@ body .cmvl-navbar-navigation span{
 }
 .parallax-hover{
     cursor: pointer;
+}
+.contact-form{
+    text-align: center;
+    max-width: 395px;
+    margin: 0 auto;
+    border: 3px solid #EDEDED;
+    padding: 5px;
+    background: #EDEDED;
+    color: #0071BC;
+    border-radius: 6px;
+    -webkit-box-shadow: 0px 37px 20px -20px rgba(0,0,0,0.2);
+       -moz-box-shadow: 0px 37px 20px -20px rgba(0,0,0,0.2);
+    box-shadow: 0px 37px 20px -20px rgba(0,0,0,0.2);
+    transition: all 200ms ease-in-out;
+    transform: scale(1.02);
+}
+.contact-form:hover{
+    cursor: pointer;
+    box-shadow: 0px 17px 10px -10px rgba(0,0,0,0.4);
+    transform: translate(0px, -3px) scale(1)
 }
\ No newline at end of file