<?php get_header();

extract(etheme_get_page_sidebar());

if( !$position || $position == 'no_sidebar' ) {
	$content_span = 'span12';
} else {
	$content_span = 'span9';
}

?>

<?php if($page_slider != 'no_slider' && $page_slider != ''): ?>
	<section class="slider">

		<?php if ( $page_slider == 'zoom_slider' ) {

			echo etheme_get_custom_field('zoom_slider');

		} else { ?>
			<div class="container">
				<?php echo do_shortcode('[rev_slider_vc alias="'.$page_slider.'"]'); ?>
			</div>
		<?php } ?>
	</section>
<?php endif; ?>

	<section id="content" class="shop">
		<div class="container<?php if ( !$page_slider || $page_slider == 'no_slider' ) { echo ' top'; } ?>">
			<div class="row">
				<?php if ( $responsive == 'top' && $position && $position != 'no_sidebar' ) { ?>
					<div class="<?php echo $sidebar_span; ?> sidebar sidebar-<?php echo $position; ?>">
						<?php
						if ( is_active_sidebar($sidebarname) ) {
							dynamic_sidebar($sidebarname);
						} else {
							echo '<p>' . __('There are no widgets added for this sidebar!', WFT_DOMAIN) . '</p>';
						}
						?>
					</div>
				<?php } //endif; ?>

				<div class="<?php echo $content_span; ?><?php if ( $position == 'left' ) { echo ' pull-right'; } ?>">

					<?php if ( isset($page_heading) && $page_heading == 'enable' ) { ?>
						<h1 class="page-title"><?php the_title( '<h1 class="page-title">', '</h1>' ); ?></h1>
					<?php } ?>

					<?php if(have_posts()): while(have_posts()) : the_post(); ?>

						<?php the_content();

						// If comments are open or we have at least one comment, load up the comment template.
						if ( comments_open() || get_comments_number() ) {
							comments_template();
						}

						wp_link_pages(array(
							'before' => '<div class="post-navigation">',
							'after' => '</div>'
						)); ?>


						<?php if (current_user_can('edit_post', $post->ID)): ?>
							<?php edit_post_link( __('Edit this', WFT_DOMAIN), '<p class="edit-link">', '</p>' ); ?>
						<?php endif ?>

					<?php endwhile; else: ?>

						<h3><?php _e('No pages were found!', WFT_DOMAIN) ?></h3>

					<?php endif; ?>
				</div>

				<?php if ( $responsive == 'bottom' && $position && $position != 'no_sidebar' ) { ?>
					<div class="<?php echo $sidebar_span; ?> sidebar sidebar-<?php echo $position; ?>">
						<?php
						if ( is_active_sidebar($sidebarname) ) {
							dynamic_sidebar($sidebarname);
						} else {
							echo '<p>' . __('There are no widgets added for this sidebar!', WFT_DOMAIN) . '</p>';
						}
						?>
					</div>
				<?php } //endif; ?>
			</div>
		</div><!-- end container -->
	</section>
<?php get_footer(); ?>