<div id="home-posts" class="container">
<h3 style="margin-top: 40px; margin-bottom: 40px;"><?php wp_title(); ?></h3>
<?php if ( have_posts() ) : ?>
<div class="facetwp-template">
<?php while ( have_posts() ) : the_post(); ?>
<div class="archive-item">
<div class="span2 borderbox buffer">
<?php if(has_post_thumbnail()):?>
<?php the_post_thumbnail('list');?>
<?php else:?>
<?php $image = get_field('author_profile_picture'); $size = 'medium';?>
<?php echo wp_get_attachment_image( $image, $size );?>
<?php endif;?>
</div>
<div class="span10 borderbox buffer" style="position: relative">
<?php if(get_field('purchase_link')):?>
<a href="<?php the_field('purchase_link');?>" class="searchResultMainLink"><h3><?php the_title(); ?></h3></a>
<?php else:?>
<a href="<?php the_permalink();?>" class="searchResultMainLink"><h3><?php the_title(); ?></h3></a>
<?php endif;?>
<?php if(get_field('conversionauthor')):?>
<p class="featured-speaker">Featuring <?php the_field('conversionauthor');?><span class="divider-bar">/</span></p>
<?php endif;?>
<p><?php echo wp_trim_words( get_the_content(), 25 ); ?></p>
<div class="clearfix"></div>
<p class="single-date" style="margin-bottom:0; margin-right: 15px; font-weight: 700;"><?php the_time(get_option('date_format')); ?></p>
<?php if(get_field('dismp3')):?>
<span class="glyphicon glyphicon-music glyphicon-right"></span>
<?php elseif(get_field('video')):?>
<span class="glyphicon glyphicon-facetime-video glyphicon-right"></span>
<?php else:?>
<span class="glyphicon glyphicon-pencil glyphicon-right"></span>
<?php endif;?>
<?php $postid = get_the_ID(); ?>
<?php $obj = get_post_type_object( get_post_type($postid) );?>
<?php $desc = $obj->description;?>
<?php if($desc != ""):?>
<p class="post-type" style="margin-right:10px"><?php echo $obj->description;?></p>
<?php else:?>
<p class="post-type" style="margin-right:10px"><?php echo $obj->labels->singular_name;?></p>
<?php endif;?>
<?php if( has_term( '', 'denomination', $post ) ):?>
<span class="glyphicon glyphicon-user glyphicon-right"></span><p class="post-type"> <?php the_terms( $post->ID, 'denomination', '', ' / ' ); ?></p>
<?php endif;?>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
<?php endwhile; ?>
</div>
<?php
// get_template_part('elements/pagination');
echo facetwp_display( 'pager' );
?>
<?php else: ?>
<?php endif; ?>
</div>