Adding single page for troutcreek packages.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Jul 2017 19:24:19 +0000 (15:24 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Jul 2017 19:24:19 +0000 (15:24 -0400)
Setting up a partial just for the post type of the trout creek packages.

index.php
lib/troutcreek-packages.php
sections/troutcreek-packages-single.php [new file with mode: 0644]

index 0effd20..400f5d2 100644 (file)
--- a/index.php
+++ b/index.php
                         include "sections/blog-archive.php";
                     }
                     if (is_single()) {
-                        include "sections/blog-single.php";
+                        $postType = get_post_type();
+                        if ( $postType == 'troutcreek_package' ) {
+                            include "sections/troutcreek-packages-single.php";
+                        } else {
+                            include "sections/blog-single.php";
+                        }
                     }
                     if (is_search()) {
                         include "sections/search.php";
index f4f29e6..f82c664 100644 (file)
@@ -187,7 +187,7 @@ function troutcreekPackagesShortcode( $atts )
                         <h3 class="pTitle"><?php echo get_the_title(); ?></h3>
                         <p><?php echo get_the_excerpt(); ?></p>
                         <a class="pDetailButton" href="<?php echo get_permalink(); ?>">&gt;&gt;View Details</a>
-                        <a target="_blank" class="pBooknow" href="{v[bookurl]:h}">Book Now</a>
+                        <a target="_blank" class="pBooknow" href="<?php echo $bookUrl; ?>">Book Now</a>
                         </div>
                     </div>
                 </div>
diff --git a/sections/troutcreek-packages-single.php b/sections/troutcreek-packages-single.php
new file mode 100644 (file)
index 0000000..231f9cc
--- /dev/null
@@ -0,0 +1,53 @@
+<main class="page-inside">
+    <?php echo glm_get_header(); ?>
+    <?php get_template_part('parts/reservation');?>
+    <div id="content-wrapper">
+        <div class="row">
+            <?php if ( function_exists('bcn_display') && !is_front_page() ) {
+                echo "<div class=\"breadcrumbs small-12 columns\">";
+                bcn_display();
+                echo "</div>";
+            }
+            ?>
+        </div>
+        <div class="row">
+            <div id="main-content" class="small-12 columns">
+                <?php if(have_posts()) : while(have_posts()): the_post();
+                // Get the image
+                $thumbnail = get_the_post_thumbnail( null, 'packageDetailSize',
+                    array( 'class' => 'pDetailImg' ) );
+                // Get the meta data
+                $custom    = get_post_custom();
+                $bookUrl   = $custom['_package_reservation'][0];
+                $savings   = $custom['_package_savings'][0];
+                $dateRange = $custom['_package_dates'][0];
+                ?>
+                    <div id="category">
+                        <div id="pDetailContainer" class="row">
+                            <div class="small-12 columns">
+                                <h1><?php echo get_the_title(); ?></h1>
+                                    <?php echo $thumbnail; ?>
+                            </div>
+                            <div class="small-12 columns">
+                                <div class="pBanners row">
+                                    <div class="pSavings small-12 medium-6 columns"><?php echo $savings ;?></div>
+                                    <div class="pDates small-12 medium-6 columns"><?php echo $dateRange ;?></div>
+                                </div>
+                            </div>
+                            <div class="small-12 columns">
+                                <?php the_content(); ?>
+                            </div>
+                            <div class="small-12 text-center columns">
+                                <?php if ( $bookUrl ) : ?>
+                                <a target="_blank" class="pBooknow pDetail" href="<?php echo $bookUrl; ?>">Book Now</a>
+                                <?php endif; ?>
+                            </div>
+                        </div>
+                    </div>
+                <?php endwhile; else:?>
+                <p><?php _e('Sorry, no posts yet');?></p>
+                <?php endif;?>
+            </div>
+        </div>
+    </div>
+</main>