<?php
/**
 * Theme Name: 		Noisa
 * Theme Author: 	Mariusz Rek - Rascals Themes
 * Theme URI: 		http://rascalsthemes.com/noisa
 * Author URI: 		http://rascalsthemes.com
 * File:			archive.php
 * @package noisa
 * @since 1.0.0
 */

get_header();

// Get panel options
$noisa_opts = noisa_opts();

// Get layout
$noisa_layout = 'main-left';

// Blog Layout
$blog_layout = $noisa_opts->get_option( 'blog_cat_layout' );

// Get Category Intro Section
get_template_part( 'inc/tag-intro' );

?>

<!-- GRID -->
<?php if ( $noisa_opts->get_option( 'blog_cat_type' ) === 'grid' ) : ?>
		
<div id="content">

	<div class="container blog-grid clearfix <?php echo esc_attr( $blog_layout ) ?>">
		<?php if ( have_posts() ) : ?>
				
				<div class="masonry masonry-blog-grid">

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

					<div class="masonry-item masonry-item-1-3">
					<?php include( locate_template( 'content.php', false, false ) );  ?>
					</div>
		
				<?php endwhile; ?>

				</div>
				<!-- .masonry -->
				<div class="clear"></div>
    			<?php noisa_paging_nav(); ?>

			<?php else : ?>
				<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'noisa' ); ?></p>

			<?php endif; // have_posts() ?>
			
	</div>
    <!-- .container -->
</div>
<!-- #content -->

<!-- List -->
<?php else : ?>

<div id="content">

	<div class="container blog-classic clearfix">

		<div role="main" class="main <?php echo esc_attr( $noisa_layout ) ?>">
		<?php
		if ( have_posts() ) :


			// Start the Loop.
			while ( have_posts() ) : the_post();
				/*
				 * Include the post format-specific template for the content. If you want to
				 * use this in a child theme, then include a file called called content-___.php
				 * (where ___ is the post format) and that will be used instead.
				 */
				include( locate_template( 'content.php', false, false ) );

			endwhile;

		else : ?>
				<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'noisa' ); ?></p>

			<?php endif; // have_posts() ?>
			<div class="clear"></div>
			<?php noisa_paging_nav(); ?>
		</div>
		<!-- .main -->
		<?php get_sidebar( 'category' ); ?>
	</div>
	<!-- .container -->
</div>
<!-- #content -->
<?php 
endif;

get_footer();