<?php
/**
 * The template for displaying a archive layouts
 *
 * @package WordPress
 * @subpackage Edition
 * @since Edition 1.0
 */

global
$custom_layout,
$background_url,
$pageID,
$page;

$pageclasses = array(
	'pagewrapper',
	$custom_layout != 'yes' ? 'regular-posts' : '',
	$background_url ? 'has-background' : 'no-background',
	$custom_layout == 'yes' ? 'custom-layout' : 'default-layout'
); ?>

<div class="<?php foreach($pageclasses as $class) { echo sanitize_html_class( $class ) . ' '; } ?>">

	<?php get_template_part('functions/templates/title-full'); ?>

	<?php if ( $custom_layout != 'yes' ) : ?>

		<div class="container">
			<div class="rightside">
				<div class="rightcontent regulargrid">

					<?php
						// Author Box
						if ( is_author() ) {
							get_template_part(TW_TEMPLATES_DIR . '/author-box');


							echo '<div class="section-title"><span>' . __('Latest Posts', 'themewich') . '</span> <span class="vertical-div"> | </span> ' . __('By', 'themewich') . ' ' . get_the_author_meta('display_name')  . '</div>';
						}
					?>

					<!-- Regular Posts -->
					<div class="regularwrapper">
						<div class="isotopecontainer" data-value="2">
							<?php
								// Post loop
								if ( have_posts() ) : while ( have_posts() ) : the_post();
									get_template_part(TW_TEMPLATES_DIR . '/regular-post'); // regular post template
								endwhile; endif; wp_reset_query();
							?>
							<div class="clear"></div>
						</div>

						<?php themewich_pagination(); // Pagination ?>

					</div><!--.regularwrapper-->

				</div><!--.rightcontent-->

				<div class="clear"></div>
			</div><!--.rightside-->

			<div class="sidebar">
				<div class="sidebarcontent">
					<?php dynamic_sidebar('Blog Sidebar'); ?>
	            </div>
	        </div>

	    </div><!--.container-->

	<?php else : ?>
		<?php get_template_part(TW_SECTIONS_DIR .'/sections'); // Display sections ?>
	<?php endif; ?>

</div><!--.pagewrapper-->