</div>
<div class="shadow-wrapper">
<div class="content-wrapper">
- <div class="row">
- <div class="small-12 columns" id="homeContent">
- <?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="row">
+ <div class="small-12 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>
- </div>
- </div>
</div>
<div class="row">
<div id="blog-feed" class="small-12 large-9 columns">
<div class="shadow-wrapper">
<div class="content-wrapper">
- <div class="row wordpress-content">
- <h1>Upcoming Events</h1>
- <?php
- $args = array( 'numberposts' => 3);
- $lastposts = get_posts( $args );
- foreach($lastposts as $post) : setup_postdata($post); ?>
- <div class="small-12 columns">
- <?php $thumbnail = get_the_post_thumbnail($post->ID, array(120, 100)); ?>
- <?php if ($thumbnail):?>
- <div class="wp-caption alignleft">
- <?php echo $thumbnail; ?>
- </div>
- <?php endif;?>
- <h2><a class="read" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <p><?php echo the_advanced_excerpt('length=75&length_type=words&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong'); ?></p>
- <a class="read" href="<?php the_permalink(); ?>">read more...</a>
- </div>
- <?php endforeach; ?>
- </div>
+ <?php get_template_part("parts/blog-feed");?>
</div>
</div>
</div>
-<?php if (is_page(array("events","recreation","sailing","tennis","activities","beach"))) { ?>
-<div class="row wordpress-content">
- <h1>Upcoming Events</h1>
+<?php
+if (is_page(array("events","recreation","sailing","tennis","activities","beach"))) {
+ $cat_name = get_query_var('name');
+} else if (is_front_page()) {
+ $cat_name = "Home Page";
+} else {
+ $cat_name = "";
+}
+?>
+
<?php
- $args = array( 'category_name' => get_query_var('name'),'numberposts' => 3, 'order_by' => 'date');
+ $args = array( 'category_name' => $cat_name,'numberposts' => 3, 'order_by' => 'date');
$lastposts = get_posts( $args );
- foreach($lastposts as $post) : setup_postdata($post); ?>
- <div class="small-12 columns">
- <?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; ?>
+ if ($lastposts) { ?>
+ <div class="row wordpress-content">
+ <h1>Upcoming Events</h1>
+ <?php foreach($lastposts as $post) : setup_postdata($post); ?>
+ <div class="small-12 columns">
+ <?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><?php echo the_advanced_excerpt('length=75&length_type=words&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong'); ?></p>
+ <a class="read" href="<?php the_permalink(); ?>">read more...</a>
</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><?php echo the_advanced_excerpt('length=75&length_type=words&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong'); ?></p>
- <a class="read" href="<?php the_permalink(); ?>">read more...</a>
</div>
+ <?php endforeach; ?>
</div>
- <?php endforeach; ?>
-</div>
-<?php } ?>
\ No newline at end of file
+ <?php } ?>
\ No newline at end of file