adding logo file, adding front page sidebar epicenter blog excerpt
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 30 Oct 2018 13:51:05 +0000 (09:51 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 30 Oct 2018 13:51:05 +0000 (09:51 -0400)
assets/logo-epicenter.png [new file with mode: 0644]
css/app.css
functions.php
rssfeed.php [new file with mode: 0644]
scss/_sidebar.scss
sidebar.php

diff --git a/assets/logo-epicenter.png b/assets/logo-epicenter.png
new file mode 100644 (file)
index 0000000..9460125
Binary files /dev/null and b/assets/logo-epicenter.png differ
index 4c9f38d..6d0369e 100644 (file)
@@ -8246,6 +8246,18 @@ a#calendar-link {
 .separator {
   color: white; }
 
+#epicenter-excerpt {
+  margin-top: 20px; }
+  #epicenter-excerpt #epicenter-post-date {
+    color: grey;
+    font-style: italic; }
+  #epicenter-excerpt h3 {
+    font-size: 21px;
+    line-height: 1.1;
+    margin-top: 15px; }
+    #epicenter-excerpt h3 a {
+      text-decoration: underline; }
+
 .search-top #searchform {
   text-align: left;
   display: inline-block;
index fd0bb56..2b5fc00 100644 (file)
@@ -575,4 +575,34 @@ add_action( 'after_setup_theme', 'woocommerce_support' );
 function woocommerce_support() {
     add_theme_support( 'woocommerce' );
 }
-?>
+
+function exclude_category( $query ) {
+    if ( $query->is_home() && $query->is_main_query() ) {
+        $query->set( 'cat', '-53' );
+    }
+}
+
+add_action( 'pre_get_posts', 'exclude_category' );
+
+function content_excerpt($post_id, $length = 35){
+    $the_post = get_post($post_id); //Gets post ID
+    if( $the_post->post_excerpt ){
+       $the_excerpt = $the_post->post_excerpt;
+    } else {
+        $the_excerpt = $the_post->post_content;
+
+    }
+    
+    $excerpt_length = $length; //Sets excerpt length by word count
+    $the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images
+    $words = explode(' ', $the_excerpt, $excerpt_length + 1);
+    
+    if(count($words) > $excerpt_length) :
+        array_pop($words);
+        array_push($words, '');
+        $the_excerpt = implode(' ', $words);
+    endif;
+
+    return $the_excerpt;
+}
+?>
\ No newline at end of file
diff --git a/rssfeed.php b/rssfeed.php
new file mode 100644 (file)
index 0000000..b3a90b3
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/*
+Template Name: RSS Feed Blog
+*/
+?>
+<?php get_header(); ?>
+<main class="blog-home">
+    <div id="head-img">
+        <div class="featured-image" style="background: url('<?php echo get_template_directory_uri();?>/assets/default.jpg') no-repeat scroll 0px bottom / cover;"></div>
+    </div>
+<!--    <article <?php // post_class() ?> id="interior-featured">
+        <?php // GLM_get_header(); ?>
+    </article> -->
+    <?php get_template_part('parts/reservation-form');?>
+    <div class="row">
+        <div id="blog-posts-over" class="small-12 medium-8 columns">
+        <?php query_posts('cat=2&posts_per_page=4'); ?>
+            <?php if(have_posts()) : while(have_posts()): the_post();?>
+            <div class="row content blog-posts-container">
+                <div class="small-11 small-centered columns">
+                    <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"><?php the_time('F jS, Y') ?></span>
+                        </header>
+                        <?php echo (function_exists('the_advanced_excerpt')) ? the_advanced_excerpt(): the_excerpt(); ?>
+                    </article>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <div class="navigation">
+                <span class="newer"><?php previous_posts_link(__('« Newer','example')) ?></span> <span class="older"><?php next_posts_link(__('Older »','example')) ?></span>
+            </div><!-- /.navigation -->
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+            <?php wp_reset_query(); ?>
+        </div>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+        <?php get_template_part('parts/interior-footer'); ?>
+    </div>
+    <?php get_footer(); ?>
\ No newline at end of file
index 1bd5b49..94a551d 100644 (file)
@@ -232,4 +232,19 @@ a#calendar-link {
 }
 .separator{
     color: white;
+}
+#epicenter-excerpt{
+    margin-top: 20px;
+    #epicenter-post-date{
+        color: grey;
+        font-style: italic;
+    }
+    h3{
+        font-size: 21px;
+        line-height: 1.1;
+        margin-top: 15px;
+        a{
+            text-decoration: underline;
+        }
+    }
 }
\ No newline at end of file
index 29b38c3..9dfda4a 100644 (file)
                                         </div>
                                     </div>
                                     <a href="<?php bloginfo('url'); ?>/e-news-sign-up/"><img alt="Newsletter Signup" src="<?php bloginfo('template_url'); ?>/assets/signup.png"></a>
+                                    <div id="epicenter-excerpt">
+                                        <div>
+                                            <img src="<?php echo get_template_directory_uri(); ?>/assets/logo-epicenter.png"  alt="">
+                                        </div>
+                                        <div>
+                                            <?php $args = array(
+                                                'posts_per_page'   => 1,
+                                                'category'         => '53',
+                                                'orderby'          => 'date',
+                                                'order'            => 'DESC',
+                                                'post_type'        => 'post',
+                                                'post_status'      => 'publish',
+                                                'suppress_filters' => true,
+
+                                            ); 
+                                            $epicenter_blog = get_posts( $args )[0]; 
+                                            $date = strtotime($epicenter_blog->post_date);
+                                            ?>
+                                            <h3><a href="<?php echo get_permalink($epicenter_blog->ID); ?>"><?php echo $epicenter_blog->post_title; ?></a></h3>
+                                            <div id="epicenter-post-date"><?php echo date("F j, Y",$date); ?></div>
+                                            <p><?php echo content_excerpt($epicenter_blog->ID, 35);?>...</p>
+                                        </div>
+                                    </div>
                                 </div>
+                                
                             </div>