<?php
/**
 * The template used for displaying projects on index view
 *
 * @package Signify
 */
?>

<?php
$show_meta    		= get_theme_mod( 'signify_portfolio_meta_show', 'show-meta' );
$layout       		= get_theme_mod( 'signify_portfolio_content_layout', 'layout-three' );
$thumbnail_style	= get_theme_mod( 'signify_portfolio_post_thumbnail_style', 'flexible');

global $post;

$categories_list = get_the_category();

$classes = 'grid-item';
foreach ( $categories_list as $signify_cat ) {
	$classes .= ' ' . $signify_cat->slug ;
}

// If not thumbnail, use 920x920 for no thumb image, so this is default.
$thumbnail = array( 920, 920 );

if ( has_post_thumbnail() ) {
	$thumbnail =  'signify-flexible';
}
?>

<article id="portfolio-post-<?php the_ID(); ?>" <?php post_class( esc_attr( $classes ) ); ?>>
	<div class="hentry-inner">
		<?php signify_post_thumbnail( $thumbnail, 'html', true, true ); ?>

		<div class="entry-container caption">
			<div class="entry-container-inner-wrap">
				<header class="entry-header">
					<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>

					<?php if ( 'show-meta' === $show_meta ) :
					?>
					<div class="entry-meta">
						<?php signify_cat_list();?>
					</div>
					<?php endif; ?>
				</header>
			</div><!-- .entry-container-inner-wrap -->
		</div><!-- .entry-container -->
	</div><!-- .hentry-inner -->
</article>
