<?php
/**
 * Template part for displaying posts list.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Cleanead
 */

$theme_options = cleanead_theme_options();

?>

<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
	<?php if ( has_post_thumbnail() ) : ?>
	<div class="post-thumbnail">
		<a href="<?php the_permalink() ?>" rel="bookmark">
			<?php the_post_thumbnail(); ?>
		</a>
	</div>
	<?php endif; ?>
	<header class="entry-header">
		<?php
			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		?>
	</header><!-- .entry-header -->

	<div class="entry-content">
		<?php if ( $theme_options['post_content'] == 'index' ) : ?>
		<div class="home-excerpt">
			<?php the_content(); ?>
		</div>
		<?php else : ?>
		<div class="home-excerpt">
			<?php the_excerpt(); ?>
		</div>
		<div class="home-entry-footer clearfix">
			<?php
			if ( 'post' === get_post_type() ) : ?>
			<div class="entry-meta">
				<?php cleanead_posted_on(); ?>
			</div><!-- .entry-meta -->
			<?php
			endif; ?>
			<a class="btn-read-more" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php _e('Read more','cleanead'); ?></a>
		</div>
		<?php endif; ?>
	</div><!-- .entry-content -->
</article><!-- #post-## -->
