<?php
/**
 * Template Name: Sources Archives
 * Description: Used as a page template to show page contents, followed by a loop through a CPT archive  
 */
 ?>
 
<?php
if ( is_archive('green_sources') ) { ?>
<?php get_header(); ?>
<div class="content-sidebar-wrap">
<main itemprop="mainContentOfPage" role="main" class="content">

<?php while ( have_posts() ) : the_post(); ?>
<div class="board-item">

    <h4><?php the_title(); ?></h4>

    <div class="board-thumb"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-middle'); ?></a></div>

    <p><?php echo word_count(get_the_excerpt(), '15'); ?>...</p>

    <span><?php the_field('title'); ?></span>

    <a class="read-link" href="<?php the_permalink(); ?>">+  Read More</a>

         

    </div>
    
    <?php $counter++; if($counter%3 == 0) {

echo '<div style="clear: both;"></div>';

} ?>
    <?php endwhile; // End the loop. Whew. ?>
</main>
<?php get_sidebar(); ?>
</div> 
<?php genesis_after_loop(); ?>

<?php get_footer(); ?> 

<?php } else { ?>
<?php genesis(); ?>
<?php } ?>
 