<?php
/**
 * The template for displaying archive pages
 *
 * Used to display archive-type pages if nothing more specific matches a query.
 * For example, puts together date-based pages if no date.php file exists.
 *
 * If you'd like to further customize these archive views, you may create a
 * new template file for each one. For example, tag.php (Tag archives),
 * category.php (Category archives), author.php (Author archives), etc.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage menda
 * @since menda Theme 1.0
 */
$page_id           = get_option( 'page_for_posts' );
$status            = get_post_meta( $page_id, '_ebid_sidebar_status', true );
$breadcrumbs       = get_post_meta( $page_id, '_ebid_breadcrumbs_status', true );
$page_title_status = get_post_meta( $page_id, '_ebid_pagetitle_status', true );
get_header(); 
?>

<?php if ( $breadcrumbs !== 'hide'  ): ?>
	<div class="bradscrum">
		<div class="container-fluid">
			<div class="row"><?php ebid_breadcrumbs(); ?></div>
		</div>
	</div>
<?php endif; ?>

<div class="container-fluid">
	<div class="col-md-12">

		<div class="row">
				
			<div class="col-sm-12 single col-md-<?php if( $status == 'hide' ){ echo '12'; }else{ echo '9'; } ?> col-lg-<?php if( $status == 'hide' ){ echo '12'; }else{ echo '9'; } ?> col-xs-12">
				
				<div id="products" class="list-group p-3">
					<div class="row">

						<header class="archive-page">
							<?php
								the_archive_title( '<h1 class="page-title">', '</h1>' );
								the_archive_description( '<div class="taxonomy-description">', '</div>' );
							?>
						</header><!-- .page-header -->

						<?php

							$i = 1;

							// Start the Loop.
							while ( have_posts() ) : the_post();
							/*
							 * Include the Post-Format-specific template for the content.
							 * If you want to override this in a child theme, then include a file
							 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
							 */
							get_template_part( 'blog/contents', get_post_format() );
								
								if( $i == 3 ):
									
									$i = 0;
										
									echo '<div class="clearfix"></div>';

								endif;

								$i++;

							// End the loop.
							endwhile;

						?>
					</div>
				
				</div><!-- .content-area -->

				<div class="text-center pagi">
				
					<?php  post_ebid_navi_pagination(); ?>
				
				</div> 

			</div>

			<?php if ( $status !== 'hide' ): ?>
				<div class="col-sm-12 right-shop col-md-3 col-lg-3 col-xs-12 ">
				    <div class="sidebar-bg">
			            <div class="sidebar-shop">
						
			            	<?php get_sidebar();   ?>
			            </div>    
			         	<div class="clearfix"></div>
					</div>
				</div>
			<?php endif; ?>
		</div>
	</div>
</div>

<?php get_footer(); ?>