Add banquets template with video widget and custom field
authorLaury GvR <laury@gaslightmedia.com>
Mon, 4 Mar 2019 23:45:09 +0000 (18:45 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 4 Mar 2019 23:45:09 +0000 (18:45 -0500)
banquets-template.php [new file with mode: 0644]
functions.php
scss/_structure.scss
sections/banquets-page.php [new file with mode: 0644]
sections/interior-page.php

diff --git a/banquets-template.php b/banquets-template.php
new file mode 100644 (file)
index 0000000..e7266b2
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+/*
+Template Name: Banquets Template
+*/
+get_template_part('index');
+?>
\ No newline at end of file
index 48d9999..f0f99f1 100644 (file)
@@ -6,6 +6,7 @@ $ancestorId   = null;
 $includePages = array();
 $frontPageId  = get_option('page_on_front');
 add_action('widgets_init', 'glm_quicksite_widget_init');
+add_action('widgets_init', 'glm_video_widget_init');
 
 if (!function_exists('glm_quicksite_widget_init')) {
 
@@ -18,6 +19,15 @@ if (!function_exists('glm_quicksite_widget_init')) {
         ));
     }
 }
+if (!function_exists('glm_video_widget_init')) {
+    function glm_video_widget_init(){
+        register_sidebar(array(
+            'name'        => __('Video'),
+            'id'          => 'video-widget',
+            'description' => __('Video Widget')
+        ));
+    }
+}
 
 /**
  * Return the client info option for the given key
index f2bb153..497931f 100644 (file)
@@ -63,6 +63,10 @@ a {
     color: $green;
 }
 //6. Main
+.widget.widget_media_video {
+    list-style: none;
+    margin-top: 60px;
+}
 //7. Slideshow
 //8. Blog 
 //9. Sidebar
diff --git a/sections/banquets-page.php b/sections/banquets-page.php
new file mode 100644 (file)
index 0000000..f240514
--- /dev/null
@@ -0,0 +1,26 @@
+<div class="row">
+    <div class="small-12 columns">
+    <?php 
+        if(function_exists('bcn_display') && !is_front_page())
+            {
+            echo "<div class=\"breadcrumbs small-12 columns\">";
+            echo '<span class="st_sharethis" st_title="'. get_the_title().'" st_url="'. get_the_permalink() .'"></span>'; 
+            bcn_display();
+            echo "</div>";
+        }
+    ?>
+    </div>
+    <div class="small-12 medium-6 columns">
+        <?php if (function_exists('the_field') && get_field('video-adjacent_content')) { ?>
+            <?php echo the_field('video-adjacent_content'); ?>
+        <?php } ?>
+    </div>
+    <div class="small-12 medium-6 columns">
+        <?php if ( is_active_sidebar( 'video-widget' ) ) : ?>
+           <?php dynamic_sidebar( 'video-widget' ); ?>
+         <?php endif; ?>
+    </div>
+    <div class="small-12 columns">
+        <?php get_template_part('parts/main-content'); ?>
+    </div>
+</div>
index 33337e3..69cb108 100644 (file)
@@ -7,18 +7,22 @@
 <main class="page-inside">
 
     <div id="content-wrapper">
-        
         <div class="row">
-            <div class="small-12 columns">
-
-                <?php if(function_exists('bcn_display') && !is_front_page())
-                {
-                   echo "<div class=\"breadcrumbs small-12 columns\">";
-                   echo '<span class="st_sharethis" st_title="'. get_the_title().'" st_url="'. get_the_permalink() .'"></span>'; 
-                   bcn_display();
-                   echo "</div>";
-               }?>
-               <?php get_template_part('parts/main-content');?>
+            <?php if(get_page_template_slug( $post->ID ) === "banquets-template.php"){ ?>
+                <?php echo get_template_part("sections/banquets-page"); ?>
+            <?php } else { ?>
+                <div class="small-12 columns">
+                <?php 
+                    if(function_exists('bcn_display') && !is_front_page())
+                        {
+                        echo "<div class=\"breadcrumbs small-12 columns\">";
+                        echo '<span class="st_sharethis" st_title="'. get_the_title().'" st_url="'. get_the_permalink() .'"></span>'; 
+                        bcn_display();
+                        echo "</div>";
+                    }
+                    get_template_part('parts/main-content'); 
+                ?>
+            <?php } ?>
            </div>
         </div>     
     </div>