<?php
/**
 * @package shrk
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('row'); ?>>

	<?php if ( has_post_thumbnail() ) : ?>
	<div class="entry-thumbnail">
		<?php if ( shrk_get_theme_option( 'blog_thumb_cover' ) ) : ?>
		<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="entry-thumb-cover lazyload-bg lazyload-on-visible" data-image-bg="<?php echo esc_url( shrk_get_post_thumbnail_url() ); ?>" data-srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_post_thumbnail_id(), 'shrk_section_bg' ) ); ?>" data-image-ar="<?php echo esc_attr( shrk_get_image_aspect( get_post_thumbnail_id(), 'shrk_section_bg' ) ); ?>">
		</a>
		<?php else : ?>
		<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
			<?php the_post_thumbnail(); ?>
		</a>
		<?php endif; ?>
	</div>
	<?php endif; ?>

	<div class="article-content col-12 col-xs-12">

		<?php if ( get_the_title() ) : ?>
		<header class="content-header">
			<h2 class="page-title">
				<span><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></span>
			</h2>
		</header><!-- .entry-header -->
		<?php endif; ?>

		<?php if ( is_search() || is_archive() ) : // Only display Excerpts for Search and Archive Pages ?>
		<div class="entry-summary">
			<?php the_excerpt(); ?>
		</div><!-- .entry-summary -->
		<?php else : ?>
		<div class="entry-content">
			<?php the_content( esc_html__( 'Read more', 'ux-shop' ) ); ?>
			<?php
				wp_link_pages( array(
					'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'ux-shop' ),
					'after'  => '</div>',
				) );
			?>
		</div><!-- .entry-content -->
		<?php endif; ?>

		<?php if ( 'post' == get_post_type() ) : ?>
		<div class="entry-meta">
		<?php shrk_entry_meta(); ?>
		</div><!-- .entry-meta -->
		<?php endif; ?>

		<footer class="entry-meta">
			<?php echo sprintf( '<a class="more-link" href="%1$s">%2$s</a>', esc_url( get_permalink( $post->ID ) ), esc_html__( 'Read more', 'ux-shop') ); ?>
			<?php edit_post_link( esc_html__( 'Edit', 'ux-shop' ), '<span class="edit-link">', '</span>' ); ?>
		</footer><!-- .entry-meta -->
	</div>
</article><!-- #post-## -->
