<?php get_header(); ?>

<div id="slider">
    <div class="inner-bg">
		<div class="container">
			<div class="row">
			   <div class="span12">
				  <h2>Dobrodošli na Vitalia.com</h2>
				  <p>Nullam malesuada urna elit, sit amet ullamcorper urna pretium id. Morbi nec volutpat nisl, sit amet pharetra ligula.</p>
				</div>
			</div>
		</div>
	</div>
</div>

<div id="content" class="col-full">

	<div id="main" class="col-left">
		<div id="products">
		<?php query_posts('post_type=products&posts_per_page=999'); ?>
		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

		<?php
		$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'main-page');
		$img = $img[0];
		?>
		<div class="product">
			<div class="product-cover">
			<span>
				<?php if(!$img) { ?>
				<a href="<?php echo get_permalink(); ?>" title="<?php echo get_the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/no-image.jpg" alt="<?php echo get_the_title(); ?>" /></a>
				<?php } else { ?>
				<a href="<?php echo get_permalink(); ?>" title="<?php echo get_the_title(); ?>"><img src="<?php echo $img; ?>" alt="<?php echo get_the_title(); ?>" /></a>
				<?php } ?>
			</span>
			</div>
			<div class="product-name">
				<a href="<?php echo get_permalink(); ?>" title="<?php echo get_the_title(); ?>"><?php echo get_the_title(); ?></a>
			</div>
		</div>
			

		<?php endwhile; ?>
      </div>

	<?php else : ?>

			<div class="post-title">			

				<h4><?php _e('No posts were found', 'cp'); ?></h4>

			</div>

		<?php endif; ?>

	</div><!-- #END main -->
	
</div><!-- #END content -->

<?php get_footer(); ?>
	
