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

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="content-theia">
			<?php if ( has_post_thumbnail() && !is_single() ) : ?>
			<figure class="imageTpost">
				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
					<img src="<?php the_post_thumbnail_url('theia-image-post'); ?>"/>
				</a>
				<?php endif; ?>
				<div class="theTheia-box">
						<header class="entry-header">
							<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

							<?php if ( 'post' == get_post_type() ) : ?>
							<div class="entry-meta">
								<?php theia_lite_posted_on(); ?>
							</div><!-- .entry-meta -->
							<?php endif; ?>
						</header><!-- .entry-header -->
						
						<div class="entry-summary">
							<?php the_excerpt(); ?>
						</div><!-- .entry-summary -->
						
						<footer class="entry-footer">
							<?php 	
								if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
									echo '<span class="comments-link"><i class="fa fa-comments-o spaceRight" aria-hidden="true"></i>';
									comments_popup_link( esc_html__( 'No Comments', 'theia-lite' ), esc_html__( '1 Comment', 'theia-lite' ), esc_html__( '% Comments', 'theia-lite' ) );
									echo '</span>';
								}
							?>
							<?php edit_post_link( esc_html__( 'Edit', 'theia-lite' ), '<span class="edit-link floatThleft"><i class="fa fa-wrench spaceRight"></i>', '</span>' ); ?>
							<span class="read-more floatThRight"><a href="<?php echo esc_url(get_permalink()); ?>"><?php esc_html_e('Read More', 'theia-lite') ?></a><i class="fa spaceLeft fa-chevron-right"></i></span>
						</footer><!-- .entry-footer -->
				</div><!-- .theTheia-box -->
			<?php if ( has_post_thumbnail() && !is_single() ) : ?>	
			</figure>
			<?php endif; ?>
	</div><!-- .content-theia -->
</article><!-- #post-## -->
