<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package OMag
 */

$theme_options = omag_theme_options();

?>



<article id="post-<?php the_ID(); ?>" <?php post_class('post type1'); ?>>
	<div class="row">
		<?php if ( has_post_thumbnail() ) {  ?>
		<figure class="col-md-6">
			<?php omag_post_thumbnail(); ?>
			<?php if( 1 === $theme_options['enable_post_tags']) {
				omag_posts_tag();
			} ?>
		</figure>
		<div class="article-content col-md-6">
		<?php } else { ?>
		<div class="article-content col-md-12">
		<?php } ?>

			<div class="entry-header">

				<?php
					the_title( '<h4 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h4>' );
				?>
				<div class="banner-info">
					<?php
						if( 1 === $theme_options['enable_post_author']) {
                		omag_posted_by();
            		} 
            		?>

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

            		<span>-</span>
					<?php omag_posts_category(); ?>
					
					<?php } ?>

				</div>
				<div class="entry-meta">
					<?php
						if( 1 === $theme_options['enable_post_date']) {
                			omag_posted_on();
            			}
            		?>

            		<?php
            			if( 1 === $theme_options['enable_comments_count']) {
            				echo '<span class="comments-link">';
            				echo '<i class="far fa-comments"></i>';
            				comments_popup_link( esc_html__( 'No Comments', 'omag' ), esc_html__( '1 Comment', 'omag' ), '% '. esc_html__( 'Comments', 'omag' ), 'post-comments');
            				echo '</span>';
            			}
        			?>
				</div>
			</div>
			<div class="entry-content">
				<p> <?php the_excerpt(); ?> </p>
			</div>
		</div>
	</div>
</article>
