updating blog code
authorIan Weller <ian@gaslightmedia.com>
Tue, 25 Oct 2016 15:40:02 +0000 (11:40 -0400)
committerIan Weller <ian@gaslightmedia.com>
Tue, 25 Oct 2016 15:40:02 +0000 (11:40 -0400)
I updated the blog code with the changes that were made for the Mackinac
Bridge blog.

archive.php
home.php
scss/_blog.scss
single.php

index b002abd..f0d80dd 100644 (file)
         <?php $status =  get_post_status($post->ID); ?>
         <div class="row content blog-posts-container">
               <!--  <div class="small-11 small-centered columns"> -->
-                <div class="small-12">
-                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
-                </div>
-                <?php 
+              <?php 
                     if (has_post_thumbnail()) {
-                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                        echo '<a href="'.get_the_permalink().'" class="blog-featured-home small-12 medium-6" style="background-image:url('.$image_data[0].');"></a>';
-                        echo '<div class="small-12 medium-6 small-centered columns right">';
+                        $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
+                <div class="small-12 medium-4 columns text-center blog-feed-imgs">
+                    <?php echo $thumbnail; ?>
+                </div>
+                <?php  echo '<div class="small-12 medium-8 small-centered columns right">';
                     } else {
                         echo '<div class="small-12 small-centered columns">';
                     }
                 ?>
                 <article id="<?php the_ID()?>" <?php post_class()?>>
+                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
                     <div class="blog-excerpt-date">
                         Posted on <strong><?php the_time('F jS, Y'); ?></strong>
                     </div>
-                    <?php echo the_advanced_excerpt(); ?>
-                    <hr class="contentBreak">
-                    
+                    <?php echo the_advanced_excerpt('length=265&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,strong,h1,h2,h3,hr,div'); ?>
                 </article>
+
             </div>
         </div>
         <?php endwhile; ?>
index baf1444..d25faa5 100644 (file)
--- a/home.php
+++ b/home.php
@@ -3,52 +3,50 @@
     <div id="header-image" class="page-header">
         <?php echo glm_get_header();?>
     </div>
-   
-    
 <!--    <article <?php // post_class() ?> id="interior-featured">
-        <?php // GLM_get_header(); ?>
+    <?php // GLM_get_header(); ?>
     </article> -->
     <div class="row">
- <div id="blog-posts-over" class="small-12 medium-9 columns">
       <div id="blog-posts-over" class="small-12 medium-9 columns">
             <?php if(have_posts()) : while(have_posts()): the_post();?>
             <?php $status =  get_post_status($post->ID); ?>
             <div class="row content blog-posts-container">
-              <!--  <div class="small-11 small-centered columns"> -->
-                <div class="small-12">
-                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
-                </div>
                 <?php 
                     if (has_post_thumbnail()) {
-                        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                        echo '<a href="'.get_the_permalink().'" class="blog-featured-home small-12 medium-6" style="background-image:url('.$image_data[0].');"></a>';
-                        echo '<div class="small-12 medium-6 small-centered columns right">';
+                        $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
+                <div class="small-12 medium-4 columns text-center blog-feed-imgs">
+                    <?php echo $thumbnail; ?>
+                </div>
+                <?php  echo '<div class="small-12 medium-8 small-centered columns right">';
                     } else {
                         echo '<div class="small-12 small-centered columns">';
                     }
                 ?>
                 <article id="<?php the_ID()?>" <?php post_class()?>>
+                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
                     <div class="blog-excerpt-date">
                         Posted on <strong><?php the_time('F jS, Y'); ?></strong>
                     </div>
-                    <?php echo the_advanced_excerpt(); ?>
-                    <hr class="contentBreak">
-                    
+                    <?php echo the_advanced_excerpt('length=265&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,strong,h1,h2,h3,hr,div'); ?>
+                    <!--                    <hr class="contentBreak">-->
                 </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 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>
-        <?php get_template_part('parts/blog-sidebar-r'); ?>
+        <!-- /#post-404 -->
+        <?php endif;?>
     </div>
-    <?php get_footer(); ?>
+<?php get_template_part('parts/blog-sidebar-r'); ?>
+</div>
+<?php get_footer(); ?>
 
 
index e6e8bce..a961e29 100644 (file)
@@ -23,9 +23,14 @@ input[type="submit"].blogbutton {
         color:  white;
     }
 }
+#blog-posts-over{
+    .search_result_context{
+        margin-bottom: 5px;
+    }
+}
 #blog-posts-over article {
-    padding-top: 10px;
-    margin-bottom: 15px;
+//    padding-top: 10px;
+//    margin-bottom: 15px;
     display: inline-block;
     width: 100%;
     z-index: 0;
@@ -37,7 +42,7 @@ input[type="submit"].blogbutton {
         margin-top: 3px;
     }
     p {
-        padding-bottom: 15px;
+//        padding-bottom: 15px;
     }
     a.read-more {
         border: 2px solid $white;
@@ -48,27 +53,41 @@ input[type="submit"].blogbutton {
         text-transform: uppercase;
         &:hover {
             background: $white;
-            border: 2px solid $teal;
+            border: 2px solid $blue;
             color: $dark-tan;
         }
     }
      .entry-header {
-        margin-bottom: 10px;
+        margin-bottom: 15px;
         .entry-title {
             margin-bottom: 0;
         }
         .meta.date {
-            font-size: 13px;
             font-weight: bold;
+            font-size: 13px;
+//            font-weight: bold;
         }
     }
-    h2.entry-title{
-        font-size: rem-calc(32);
+    h1.entry-title{
+        line-height: 1.2;
+        font-size: rem-calc(38);
     }
     .single-title{
+        & a{
+            text-decoration: none;
+        }
         padding-bottom: 15px;
     }
 }
+article .entry-header .featured-image-wrap{
+    margin-bottom: 25px;
+}
+.blog-excerpt-date{
+    font-size: 12px;
+    margin-bottom: 10px;
+    color: grey;
+
+}
 /*#searchform div input &[type="text"] {
     width: 95%;
 }*/
@@ -78,7 +97,7 @@ input[type="submit"].blogbutton {
     font-size: 12px;
 }
 #blog-posts-over > div {
-    margin: 25px 0;
+    margin: 25px 0 50px 0;
 }
 #blog-side-info {
     #searchform {
@@ -128,3 +147,4 @@ input[type="submit"].blogbutton {
 #addthis_wrapper{
     float: right;
 }
+
index b2ff43d..ef8d645 100644 (file)
@@ -16,7 +16,7 @@
                                     <h2 class="entry-title single-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
                                     <?php if ( has_post_thumbnail() ):?>
                                              <?php if (get_post_type( $post ) != "ai1ec_event") { ?>
-                                    <div class="featured-image-wrap"><?php the_post_thumbnail("large"); ?></div>
+                                        <div class="featured-image-wrap"><?php the_post_thumbnail("large"); ?></div>
                                     <?php } ?>
                                     <?php endif; ?>
                                     <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
                                     <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5135fe4558d287a9"></script>
                                     <!--                                        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>-->
                                     <!-- AddThis Button END -->
-                                </div><!--/#addthis_wrapper-->
+                                    </div><!--/#addthis_wrapper-->
                                 </header>
                                 <?php echo the_content(); ?>
                                 <?php if (!is_post_type("ai1ec_event")) { ?>
-                                <div id="addthis_wrapper">
-                                    <!-- AddThis Button BEGIN -->
-                                    <div class="addthis_toolbox addthis_default_style ">
-                                        <a class="addthis_counter addthis_pill_style"></a>
-                                    </div>
-                                    <script type="text/javascript">var addthis_config = {"data_track_addressbar":false};</script>
-                                    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5135fe4558d287a9"></script>
-                                    <!--                                        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>-->
-                                    <!-- AddThis Button END -->
-                                </div><!--/#addthis_wrapper-->
+                                
                                 <?php } ?>
                             </article>
                             <?php if ( comments_open() || get_comments_number() ) :
@@ -61,4 +52,4 @@
         </div>
         <?php get_template_part('parts/blog-sidebar-r'); ?>
     </div>
-    <?php get_footer(); ?>
+    <?php get_footer(); ?>
\ No newline at end of file