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

?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="inner-box">
		<?php if ( has_post_thumbnail() ) : ?>
			<div class="image-box">
				<figure class="image"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_post_thumbnail(); ?></a></figure>
				</div>
			<?php endif; ?>	
			<div class="lower-content">
				<ul class="post-info">
					<li class="category"><?php the_category(', '); ?></li>
					<li class="author"><?php esc_html_e('By','storex'); ?> <a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php echo esc_html( get_the_author() ); ?></a></li>
				</ul>
				<?php 
				if ( is_single() ) :

					the_title('<h3 class="post-title">', '</h3>' );

				else:

					the_title( sprintf( '<h3 class="post-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );

				endif; 
				wp_link_pages( array(
				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'storex' ),
				'after'  => '</div>',
			) ); ?>
			</div>
		</div>
	</div>