adding proper feed for the blog in the footer
authorIan Weller <ian@gaslightmedia.com>
Tue, 1 Mar 2016 14:56:17 +0000 (09:56 -0500)
committerIan Weller <ian@gaslightmedia.com>
Tue, 1 Mar 2016 14:56:17 +0000 (09:56 -0500)
footer.php
parts/blog-feed-front.php [new file with mode: 0644]

index 810bb52..2cd419f 100644 (file)
                                 </div>
                                 <div id="title-feed" class="small-12 medium-4 columns">
                                     <h2>From The Blog</h2>
-                                    <h3><a>Igendes rem Nequis sitae doluptati as. Luis sitae dolu</a></h3>
-                                    <h3><a>Mag niatas que occate volorum.</a></h3>
-                                    <h3><a>Au libus etum re, consequi odit, suntota.</a></h3>
-                                    <h3><a>Chit quam alique et volo corem hillaut unt.</a></h3>
+                                    <?php get_template_part('parts/blog-feed-front');?>
                                 </div>
                                 <div id="webcam" class="small-12 medium-4 columns">
                                     <img src="<?php bloginfo('template_url'); ?>/assets/web-cam-image-fpo.jpg">
diff --git a/parts/blog-feed-front.php b/parts/blog-feed-front.php
new file mode 100644 (file)
index 0000000..46928ff
--- /dev/null
@@ -0,0 +1,13 @@
+    <?php
+    $args = array('numberposts' => 4, 'order_by' => 'date');
+    $lastposts = get_posts( $args );
+    if ($lastposts) { ?>
+
+            <div id="blog-feed-front">
+                <?php foreach($lastposts as $post) : setup_postdata($post); ?>
+
+                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
+                                
+                <?php endforeach; ?>
+            </div>
+    <?php } ?>