<?php
/**
 * The main template file.
 *
 * @package shrk
 */

get_header(); ?>

<div <?php echo apply_filters( 'shrk-page-cover-atts', 'page-cover' ); ?> >
	<header class="page-header">
		<?php if ( is_home() ) : ?>
			<h1 class="page-title"><?php echo get_option( 'page_for_posts' ) ? get_the_title( get_option( 'page_for_posts' ) ) : esc_html_x( 'Latest posts', 'blog page title', 'ux-shop' ); ?></h1>
		<?php else : ?>
			<h1 class="page-title"><?php the_title(); ?></h1>
		<?php endif; ?>
	</header><!-- .entry-header -->
	<?php do_action( 'shrk-page-cover-after' ); ?>
</div>

<div class="container container-main-content">
	<div class="row">
		<div class="main-content-inner col-12 <?php echo esc_attr(shrk_get_main_inner_class()); ?>">            

			<?php if ( have_posts() ) : ?>

				<?php /* Start the Loop */ ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php
						get_template_part( 'content', get_post_format() );
					?>

				<?php endwhile; ?>

				<?php shrk_content_nav( 'nav-below', 'container' ); ?>

			<?php else : ?>

				<?php get_template_part( 'no-results', 'index' ); ?>

			<?php endif; ?>

			<?php get_sidebar(); ?>

        </div><!-- close .*-inner (main-content or sidebar, depending if sidebar is used) -->
    </div><!-- close .row -->
</div><!-- close .container .container-main-content -->

<?php get_footer(); ?>