<?php 
get_header();
global $page, $paged;
?>
<div class="container-fluid posts-wrapper">
 <div class="row-fluid">

<?php if(imwb_zonpress_get_option('catsidebar') == '1' && is_active_sidebar("sidebar-catpage-widget")) { ?>
   <div id="post-sidebar" class="span4 content_sidebar left">
	   <?php dynamic_sidebar("sidebar-catpage-widget"); ?>
   </div>
<?php } ?>

<div class="<?php echo (imwb_zonpress_get_option('catsidebar') == '0' || !is_active_sidebar("sidebar-catpage-widget")) ? 'span12' : 'span8';?> the-post"> 
	<?php if ( have_posts() ) : ?>
		<header class="archive-header">
			<h1 class="archive-title"><?php echo single_cat_title( '', false ); ?></h1>

			<?php if ( category_description() ) : // Show an optional category description ?>
			<div class="archive-meta"><?php echo category_description(); ?></div>
			<?php endif; ?>
		</header><!-- .archive-header -->
      <ul class="cat-post-list">
		<?php /* The loop */ ?>
		<?php while ( have_posts() ) : the_post(); 
   		$zp_is_product = false;
   		$ctr_track_attr = "'";
   		if(imwb_zonpress_is_product()) {
      		imwb_zonpress_update_imp();
   		   $zp_is_product = true;
   		   $ctr_track_attr = "zp-ctr-track' data-post-item='".get_the_ID()."'";  
   		}	
		?>
		   <li>
		   <a class='image <?php echo $ctr_track_attr;?> href="<?php echo imwb_zonpress_get_post_permalink('image'); ?>" alt="" <?php echo imwb_zonpress_get_post_link_target();?>><?php imwb_zonpress_the_post_thumbnail(get_the_ID(), "170", "140"); ?></a>
		   <a class='title <?php echo $ctr_track_attr;?> href="<?php echo imwb_zonpress_get_post_permalink('title'); ?>" alt="" <?php echo imwb_zonpress_get_post_link_target();?>><?php the_title(); ?></a>
		    <?php if(imwb_zonpress_is_product() && imwb_zonpress_get_option('hidecatprice') != "Y") { ?>
   		    <?php imwb_zonpress_post_price()?>
   		 <?php } ?>
		   </li>	
		<?php endwhile; ?>
      </ul>
	<?php endif; ?>

 </div>
 <?php if(imwb_zonpress_get_option('catsidebar') == '2' && is_active_sidebar("sidebar-catpage-widget")) { ?>
    <div id="post-sidebar" class="span4 content_sidebar right">
 	   <?php dynamic_sidebar("sidebar-catpage-widget"); ?>
    </div>
 <?php } ?>
 </div>
 
 <div class="row-fluid">
 <div class="span12">
 <?php imwb_zonpress_page_numbers(); ?>
 </div>
 </div>
</div>

<?php get_footer(); ?>