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

$theme_options  = wacko_theme_options();

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header page-header">
		<?php
		if ( is_singular() ) :
			the_title( '<h3 class="entry-title">', '</h3>' );
		else :
			the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
		endif;

		if ( 'post' === get_post_type() ) : ?>
		<?php if( 1 === $theme_options['enable_post_date'] || 1 === $theme_options['enable_post_author'] ) { ?>
		<div class="entry-meta">
			<?php wacko_posted_on(); ?>
		</div><!-- .entry-meta -->
		<?php
			}
		endif; ?>
	</header><!-- .entry-header -->



        <div class="entry-content">
          <div class="row">
          <?php
          	if ( has_post_thumbnail() ) {
          	?>
            <div class="col-xs-12 col-sm-6 col-md-6 sec-img">
              <figure>
               	<a href="<?php the_permalink(); ?>">
               		<?php the_post_thumbnail( 'wacko-blog' ); ?>
           		</a>
             </figure>
            </div><!--sec-img-->
            
           <div class="col-xs-12 col-sm-6 col-md-6 sec-text">
           <?php } else { ?>
			<div class="col-xs-12 col-sm-12 col-md-12 sec-text">
           <?php } ?>

           <?php the_excerpt(); ?>

            <a href="<?php the_permalink(); ?>" class="btn btn-default read-more">
				<?php echo esc_html__( 'Continue reading', 'wacko' ); ?><i class="fa fa-angle-right" aria-hidden="true"></i>
			</a>

          </div><!--sec-img-->
        </div><!--row-->
      </div><!--entry-content-->

	<?php if( 1 === $theme_options['enable_post_meta'] ) { ?>

		<footer class="entry-footer">
			<?php wacko_entry_footer(); ?>
		</footer><!-- .entry-footer -->

	<?php } ?>

</article><!-- #post-<?php the_ID(); ?> -->
