<?php
/**
 * The template part for displaying post in a posts listing
 *
 * @package Meridian One
 * @since 1.0
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

	<?php if ( has_post_thumbnail() ) : ?>
		<div class="blog-post-thumb">
			<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'meridian-one-posts-listing' ); ?></a>
		</div><!-- .blog-post-thumb -->
	<?php endif; ?>

	<div class="blog-post-main">

		<h2 class="blog-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

		<div class="blog-post-meta clearfix">

			<span class="post-meta-date">
				<?php echo get_the_time( get_option( 'date_format' ), get_the_ID() ); ?>
			</span><!-- .post-meta-date -->
			<span class="post-meta-separator">&#8212;</span>
			<span class="post-meta-comments">
				<a href="<?php comments_link(); ?>"><span class="blog-post-share-count"><?php comments_number( esc_html__( '( 0 ) Comments', 'meridian-one' ), esc_html__( '( 1 ) Comment', 'meridian-one' ), esc_html__( '( % ) Comments', 'meridian-one' ) ); ?></span></a>
			</span><!-- .post-meta-comments -->
			<span class="post-meta-separator">&#8212;</span>
			<span class="post-meta-author">
				<?php
					// author
					echo sprintf(
						esc_html_x( 'By %s', 'post author', 'meridian-one' ),
						'<span class="blog-post-single-meta-info-author"><a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
					);
				?>
			</span><!-- .post-meta-author -->
			<?php if ( current_user_can( 'edit_posts' ) ) : ?>
				<span class="post-meta-separator">&#8212;</span>
				<?php edit_post_link( esc_html__( 'Edit', 'meridian-one' ), '<span class="edit-link">', '</span>' ); ?>
			<?php endif; ?>

		</div><!-- .blog-post-meta -->

		<div class="blog-post-excerpt">
			<?php the_excerpt(); ?>
		</div><!-- .blog-post-excerpt -->

	</div><!-- .blog-post-main -->

</article><!-- .blog-post -->
