adding a widget area
authorIan Weller <ian@gaslightmedia.com>
Tue, 24 Jan 2017 21:19:35 +0000 (16:19 -0500)
committerIan Weller <ian@gaslightmedia.com>
Tue, 24 Jan 2017 21:19:35 +0000 (16:19 -0500)
Adding a widget area for the slideshow.

functions.php
parts/slide-show.php

index f6f32e6..6dc7759 100644 (file)
@@ -15,6 +15,11 @@ if (!function_exists('glm_quicksite_widget_init')) {
             'id'          => 'sidebar-r',
             'description' => __('Appears in Right Sidebar')
         ));
+        register_sidebar(array(
+            'name'        => __('Slideshow'),
+            'id'          => 'slideshow',
+            'description' => __('Slideshow/Metaslider Area')
+        ));
         //register_sidebar(array(
         //    'name'        => __('Footer'),
         //    'id'          => 'sidebar-f',
index d5f02ac..108121c 100644 (file)
@@ -1,11 +1,10 @@
-<?php if (is_front_page()) {
-    echo '<div id="slideshow">';
-    echo do_shortcode("[metaslider id=14]");
-    echo do_shortcode("[metaslider id=34]");
-    echo do_shortcode("[metaslider id=840]");
-    echo '</div>';
-}
-?>
+<?php if (is_front_page()) : ?>
+       <div id="slideshow">
+            <?php if ( is_active_sidebar( 'slideshow' ) ) : ?>
+               <?php dynamic_sidebar( 'slideshow' ); ?>
+            <?php endif; ?>
+       </div>
+<?php endif; ?>
 <div class="row collapse">
     <div class="small-12 columns">
         <h2 id="slide-text">Life… Is Good… In The Center Of It All</h2>