Add landing page template
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 31 Oct 2017 15:10:23 +0000 (11:10 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 31 Oct 2017 15:10:23 +0000 (11:10 -0400)
Setup like Petoskey Area theme landing page.
But using the styles from the Blocks.

functions.php
index.php
landingpage-template.php [new file with mode: 0644]
sections/landing-page.php [new file with mode: 0644]

index a7b4cef..7fb5f80 100644 (file)
@@ -155,7 +155,7 @@ add_action('init', 'mytheme_init', 10);
 function wpse_setup_theme() {
     add_image_size('glm-block-image', 290, 190,true);
 }
-
+// add_image_size('subcat_image', 250,125,true);
 add_action( 'after_setup_theme', 'wpse_setup_theme' );
 function mytheme_search_loop() {
   while ( have_posts() ) : the_post(); ?>
index 04474b0..f8e5ee6 100644 (file)
--- a/index.php
+++ b/index.php
                         include "sections/search.php";
                     }
                     if (is_page() && !is_front_page()) {
-                        include "sections/interior-page.php";
+                        $template = get_page_template_slug( $post->ID );
+                        if ( $template == 'landingpage-template.php' ) {
+                            include "sections/landing-page.php";
+                        } else {
+                            include "sections/interior-page.php";
+                        }
                     }
                     include "sections/footer.php";
 //                    include "sections/copyright.php";
@@ -40,4 +45,4 @@
         <script charset="utf-8" type="text/javascript" src="//ws.sharethis.com/button/buttons.js"></script>
         <script charset="utf-8" type="text/javascript">stLight.options({"publisher":"wp.c3d3647e-de70-4780-b71d-6b739fad685a"});var st_type="wordpress4.3.1";</script>
     </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/landingpage-template.php b/landingpage-template.php
new file mode 100644 (file)
index 0000000..bc72fc8
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+/** Template Name: Landing Page
+ */
+get_template_part('index');
diff --git a/sections/landing-page.php b/sections/landing-page.php
new file mode 100644 (file)
index 0000000..526d8ab
--- /dev/null
@@ -0,0 +1,71 @@
+<div id="header-separator" class="header-separator-interior">
+    <h1><?php
+        if ( is_member() ) {
+            echo get_member_name();
+        } else if ( glm_is_event_detail() ) {
+            if (glm_is_event_detail()) {
+                echo glm_get_event_name();
+            }
+        } else {
+            echo get_the_title();
+        }
+        ?>
+    </h1>
+</div>
+<main class="page-inside">
+    <div id="content-wrapper">
+        <div class="row">
+
+            <?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 class="row">
+                <?php get_template_part('parts/main-content');?>
+            </div>
+
+            <div class="glm-blocks-container row">
+            <?php
+            global $post;
+            $args = array(
+                'post_type'      => 'page',
+                'posts_per_page' => -1,
+                'post_parent'    => $post->ID,
+                'order'          => 'ASC',
+                'orderby'        => 'menu_order'
+            );
+
+            $post_parent = $post->ID;
+            $parent = new WP_Query( $args );
+            ?>
+            <?php if ( $parent->have_posts() ) : ?>
+             <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
+              <?php $status = get_post_status(); ?>
+              <?php if ($status !== 'private' && $status !== 'draft'){ ?>
+               <?php $id = get_the_ID();
+                    if(get_post_thumbnail_id($id)){
+                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'glm-block-image');
+                    } else {
+                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_parent), 'glm-block-image');
+                    }
+               ?>
+
+                <div id="<?php the_ID(); ?>" class="text-center small-12 medium-4 columns large-text-left glm-block">
+                       <a href="<?php echo get_permalink($id); ?>">
+                        <img class="child-image" src="<?php echo $image_data[0]; ?>" />
+                       </a>
+                    <a class="glm-block-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h1><?php the_title(); ?></h1></a>
+                </div>
+            <?php } ?>
+            <?php endwhile; ?>
+
+            <?php endif; wp_reset_query(); ?>
+            </div>
+
+        </div>
+    </div>
+</main>