Ensure even pages with different templates are allowed the book now button
authorLaury GvR <laury@gaslightmedia.com>
Thu, 18 Apr 2019 23:34:16 +0000 (19:34 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 18 Apr 2019 23:34:16 +0000 (19:34 -0400)
functions.php
parts/main-content.php
sections/interior-page.php

index 4003bbc..f5a0ff1 100644 (file)
@@ -6,6 +6,15 @@ require_once 'lib/rooms.php';
 $ancestorId   = null;
 $includePages = array();
 $frontPageId  = get_option('page_on_front');
+$pages_with_booknow = [
+    86, // Rooms & Suites
+    90, // Amenities
+    92, // Packages & Offers
+    94, // Weddings
+    98, // Meeting Venues
+    100,// Group Activities
+    116 // Swim & Fitness
+];
 add_action('widgets_init', 'glm_quicksite_widget_init');
 define("BUILDERS_PAGE_ID",      74 ); // L:34, dev55:74
 define("HOTEL_PAGE_ID",         84 ); // L:13, dev55:84
index ef48b63..10349ca 100644 (file)
@@ -1,3 +1,13 @@
+
+            <?php
+                if ( in_array( get_the_id(), $pages_with_booknow ) ) {
+                    ?>
+                        <div class="booknow-button-container">
+                            <a class="booknow-button" href="<?php echo get_permalink(1384); ?>">Book Now</a>
+                        </div>
+                    <?php 
+                }
+            ?>
             <?php if ( is_page( HOTEL_PAGE_ID ) ) { ?>
             <div id="main-content" class="small-12 medium-9 columns">
             <?php } else if ( is_in_tree( BUILDERS_PAGE_ID ) ) { ?>
index 4a0f1c0..e315557 100644 (file)
                             bcn_display();
                             echo "</div>";
                         }?>
-                        <?php
-                            // 86 Rooms & Suites
-                            // 90 Amenities
-                            // 92 Packages & Offers
-                            // 94 Weddings
-                            // 98 Meeting Venues
-                            // 100 Group Activities
-                            // 116 Swim & Fitness
-                            $pages_with_booknow = [
-                                86, 90, 92, 94, 98, 100, 116
-                            ];
-                            if ( in_array( get_the_id(), $pages_with_booknow ) ) {
-                                ?>
-                                    <div class="booknow-button-container">
-                                        <a class="booknow-button" href="<?php echo get_permalink(1384); ?>">Book Now</a>
-                                    </div>
-                                <?php 
-                            } else {
-                                echo "The id is " . get_the_id();
-                            }
-                        ?>
                         <?php get_template_part('parts/main-content');?>
                     </div>
                 <?php }