Blog feed front page, few style edits.
authorLaury GvR <laury@gaslightmedia.com>
Tue, 21 Jul 2015 16:03:49 +0000 (12:03 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 21 Jul 2015 16:05:20 +0000 (12:05 -0400)
css/app.css
front-page.php
parts/blog-feed-front.php [new file with mode: 0644]
parts/glm-blocks.php
scss/_main.scss

index 12568ad..8e4b010 100644 (file)
@@ -6849,6 +6849,9 @@ header {
   line-height: 1.4;
   margin-bottom: 0.9375rem; }
 
+#main-content {
+  margin-top: 60px; }
+
 .breadcrumbs {
   margin: 30px 0 20px; }
 
index d4532d2..6e40c43 100644 (file)
@@ -1,5 +1,5 @@
 <?php get_header(); ?>
-<main class="page-front">
+<main id="page-front">
     <div id="slide">
         <div  class="row collapse">
             <div class="large-8 columns show-for-large-up right">
                     <li id="workshops"><a href="<?php bloginfo('url'); ?>/business-assistance/trainings-workshops"><img src="<?php echo get_template_directory_uri(); ?>/assets/training-and-workshops.jpg"></a></li>
                 </ul>
             </div>
-        </div>    
+        </div>
         <div class="row">
-            <div id="main-content" class="small-12 medium-6 large-5 columns">
-                <?php if(have_posts()) : while(have_posts()): the_post();?>
-                <?php the_content();?>
-                <?php endwhile; else:?>
-                <p><?php _e('Sorry, no posts yet');?></p>
-                <?php endif;?>  
+            <div class="small-12 medium-6 large-5 columns">
+                <h1>Latest News</h1>
+                <?php 
+                get_template_part('parts/blog-feed-front'); 
+                ?>
             </div>
             <div class="small-12 medium-6 large-7 columns small-text-center medium-text-left">
+                <h1>Pertinent Information</h1>
                 <?php
                 get_template_part('parts/glm-blocks');
                 ?>
             </div>
         </div>
+        <div class="row">
+            <div id="main-content" class="small-10 small-centered columns">
+                <?php if(have_posts()) : while(have_posts()): the_post();?>
+                <?php the_content();?>
+                <?php endwhile; else:?>
+                <p><?php _e('Sorry, no posts yet');?></p>
+                <?php endif;?>  
+            </div>
+        </div>
     </div>
 <?php get_footer(); ?>
     
\ No newline at end of file
diff --git a/parts/blog-feed-front.php b/parts/blog-feed-front.php
new file mode 100644 (file)
index 0000000..9802084
--- /dev/null
@@ -0,0 +1,28 @@
+    <?php
+    $args = array('numberposts' => 3, 'order_by' => 'date');
+    $lastposts = get_posts( $args );
+    if ($lastposts) { ?>
+
+            <div class="content-wrapper">
+                <div class="row wordpress-content">
+                <?php foreach($lastposts as $post) : setup_postdata($post); ?>
+                    <div class="small-12 columns blog-feed-post">
+                        <?php $thumbnail = get_the_post_thumbnail($post->ID, array(130, 130)); ?>
+                        <?php if ($thumbnail) { ?>
+                            <div class="small-3 columns blog-feed-image">
+                                    <?php echo $thumbnail; ?>
+                            </div>
+                            <div class="small-9 columns blog-feed-text">
+                        <?php } else { ?>
+                            <div class="small-12 columns blog-feed-text">
+                        <?php } ?>
+                        <h2><a class="read" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
+                        <p id="date" class="italic"><?php echo get_the_date('D, F j, Y g:iA', $post->ID); ?></p>
+                        
+                        <p><?php echo the_advanced_excerpt('length=200&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong'); ?></p>
+                        </div>
+                    </div>
+                <?php endforeach; ?>
+                </div>
+            </div>
+    <?php } ?>
\ No newline at end of file
index 40601dd..a3ace02 100644 (file)
@@ -3,16 +3,23 @@
 <div class="blocks">
     <?php foreach ($blocks as $block):?>
     <div class="row">
+        
+    <?php if ($block->thumbnail) { ?>
         <div class="small-12 medium-4 columns block block-img">
             <?php if($block->url):?>
             <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
             <?php endif;?>
+                       
+                            
             <?php echo $block->thumbnail;?>
             <?php if($block->url):?>
             </a>
             <?php endif;?>
         </div>
-        <div class="small-12 medium-8 columns block block-content">
+        <div class="small-11 medium-8 columns block block-content">
+    <?php } else { ?>
+        <div class="small-11 right columns block block-content">
+    <?php } ?>
             <?php if($block->url):?>
             <a class="title-posts" href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
             <?php endif;?>
index c00b974..60d65a3 100644 (file)
@@ -9,6 +9,9 @@
         }
     }
 }
+#main-content {
+    margin-top: 60px;
+}
 .breadcrumbs {
     margin: 30px 0 20px;
 }