for templates for coupons feature/couponTemplates
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Jan 2016 21:22:26 +0000 (16:22 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Jan 2016 21:22:26 +0000 (16:22 -0500)
archive-glm_coupons.php [new file with mode: 0644]
single-glm_coupons.php [new file with mode: 0644]
taxonomy-glm_couponscategory.php [new file with mode: 0644]

diff --git a/archive-glm_coupons.php b/archive-glm_coupons.php
new file mode 100644 (file)
index 0000000..95511d1
--- /dev/null
@@ -0,0 +1,68 @@
+<?php get_header(); ?>
+<?php glm_get_header(); ?>
+<div id="crumb-line">
+    <div class="row">
+        <?php
+        get_template_part('parts/bread-crumbs');
+        ?>
+    </div>
+</div>
+<main class="blog-archive">
+    <article <?php post_class() ?> id="interior">
+
+    </article>
+    <div class="row">
+       <!-- breadcrumbs part -->
+        <div id="blog-posts-over" class="small-12 medium-9 columns">
+            <?php
+            $midnight = strtotime(date('Y-m-d',time()).' 00:00:00');
+            $args = array(
+                'post_type' => GLM_COUPON_POST_TYPE,
+                'meta_query' => array(
+                    array(
+                        'key'     => 'glm_coupons_enddate',
+                        'value'   => $midnight,
+                        'compare' => '>='
+                    ),
+                    array(
+                        'key'     => 'glm_coupons_startdate',
+                        'value'   => $midnight,
+                        'compare' => '<='
+                    )
+                )
+            );
+            $query = new WP_Query($args);
+            ?>
+            <h1>Coupon Archive</h1>
+            <?php if($query->have_posts()) : while($query->have_posts()): $query->the_post();?>
+            <div class="row content blog-posts-container">
+<!--                <div class="small-11 small-centered columns">-->
+                   <?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
+                <?php if ($thumbnail) { ?>
+                <div class="small-12 medium-4 columns text-center blog-feed-imgs">
+                    <?php echo $thumbnail; ?>
+                </div>
+                <div class="small-12 medium-8 columns blog-feed-contents">
+                    <?php } else { ?>
+                    <div class="small-12 columns blog-feed-content">
+                        <?php } ?>
+                    <article id="<?php the_ID()?>" <?php post_class()?>>
+                        <header class="entry-header">
+                            <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
+                            <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
+                        </header>
+                        <?php echo (function_exists('the_advanced_excerpt'))
+    ? the_advanced_excerpt('length=250&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,div,h1,h2,h3,h4,h5,h6')
+    : the_excerpt(); ?>
+                    </article>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+        </div>
+    </div>
+    <?php get_footer(); ?>
diff --git a/single-glm_coupons.php b/single-glm_coupons.php
new file mode 100644 (file)
index 0000000..5a3e27a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php get_header(); ?>
+<div class="bg-container">
+<main class="page-inside">
+        <div id="content-wrapper">
+            <?php glm_get_header();?>
+            <div id="crumb-line">
+                <div class="row">
+                    <?php
+                    get_template_part('parts/bread-crumbs');
+                    ?>
+                </div>
+            </div>
+
+            <div class="row">
+                <div id="main-content" class="small-12 columns">
+                        <?php if(have_posts()) : while(have_posts()): the_post();?>
+                        <?php the_content();?>
+                        <?php endwhile; else:?>
+                        <p><?php _e('Sorry, no results found.');?></p>
+                        <?php endif;?>
+                </div>
+            </div>
+        </div>
+
+<?php get_footer(); ?>
+
diff --git a/taxonomy-glm_couponscategory.php b/taxonomy-glm_couponscategory.php
new file mode 100644 (file)
index 0000000..3803fa9
--- /dev/null
@@ -0,0 +1,68 @@
+<?php get_header(); ?>
+<?php glm_get_header(); ?>
+<div id="crumb-line">
+    <div class="row">
+        <?php
+        get_template_part('parts/bread-crumbs');
+        ?>
+    </div>
+</div>
+<main class="blog-archive">
+    <article <?php post_class() ?> id="interior">
+
+    </article>
+    <div class="row">
+       <!-- breadcrumbs part -->
+        <div id="blog-posts-over" class="small-12 medium-9 columns">
+            <h1>Coupon Category</h1>
+            <?php
+            $midnight = strtotime(date('Y-m-d',time()).' 00:00:00');
+            $args = array(
+                'post_type' => GLM_COUPON_POST_TYPE,
+                'meta_query' => array(
+                    array(
+                        'key'     => 'glm_coupons_enddate',
+                        'value'   => $midnight,
+                        'compare' => '>='
+                    ),
+                    array(
+                        'key'     => 'glm_coupons_startdate',
+                        'value'   => $midnight,
+                        'compare' => '<='
+                    )
+                )
+            );
+            $query = new WP_Query($args);
+            ?>
+            <?php if($query->have_posts()) : while($query->have_posts()): $query->the_post();?>
+            <div class="row content blog-posts-container">
+<!--                <div class="small-11 small-centered columns">-->
+                   <?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
+                <?php if ($thumbnail) { ?>
+                <div class="small-12 medium-4 columns text-center blog-feed-imgs">
+                    <?php echo $thumbnail; ?>
+                </div>
+                <div class="small-12 medium-8 columns blog-feed-contents">
+                    <?php } else { ?>
+                    <div class="small-12 columns blog-feed-content">
+                        <?php } ?>
+                    <article id="<?php the_ID()?>" <?php post_class()?>>
+                        <header class="entry-header">
+                            <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
+                            <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
+                        </header>
+                        <?php echo (function_exists('the_advanced_excerpt'))
+    ? the_advanced_excerpt('length=250&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,div,h1,h2,h3,h4,h5,h6')
+    : the_excerpt(); ?>
+                    </article>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+        </div>
+    </div>
+    <?php get_footer(); ?>