<?php get_header(); ?>

			<!-- BEGIN MAIN -->
			<div id="main">
				
				<?php $fake_loop = new WP_Query('showposts=5'); while($fake_loop->have_posts()): $fake_loop->the_post(); ?>
				<?php endwhile; ?>
			
				<?php if(get_option('pyre_featured_slider') == 'On' && get_option('pyre_featured_slider_category')): ?>
				<?php
				if(get_option('pyre_feature_slider') != 'recent_posts') {
					$featured_posts = new WP_Query(array(
						'showposts' => 4,
						'cat' => get_option('pyre_featured_slider_category')
					));
				} else {
					$featured_posts = new WP_Query(array(
						'showposts' => 4
					));
				}
				?>
				<!-- BEGIN WRAPPER-FEATURED -->
				<div id="wrapper-featured">
				
					<div id="wrapper-slides">
					
						<div id="slider" class="nivoSlider">
							<?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
								<?php if(has_post_thumbnail()): ?>
									<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'slider-image'); ?>
									<?php $image_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'slider-thumbnail'); ?>
									<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php echo $image_thumb[0]; ?>" width='580' height='360' /></a>
								<?php endif; ?>
							<?php endwhile; ?>
						</div>
						
						<?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
						<?php endwhile; ?>
                    </div>
				</div>
				<!-- END WRAPPER-FEATURED -->
				<?php endif; ?>
				
				<!-- BEGIN HOMEPAGE BLOCKS -->
				<?php if(get_option('pyre_homepage_style') == 'magazine'): ?>
					<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage')): ?>
					<div class="homepage-widget pyre_homepage_1col">
						<div class="block full clearfix">
							
							<h3>Recent Posts<span></span></h3>
							
							<?php
							$recent_posts = new WP_Query(array(
								'showposts' => 4
							));
							$count = 1;
							?>

							<div class="block-content clearfix">
								<?php while($recent_posts->have_posts()): $recent_posts->the_post(); ?>
								<?php if($count == 1): ?>
								<div class="big-block clearfix">
									<?php if(has_post_thumbnail()): ?>
									<div class="post-thumb-container clearfix">
										<?php
										if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
											$icon = '<span class="post-format-big ' . get_post_format($post->ID) . '"></span>';
										} else {
											$icon = '';
										}
										echo $icon;
										?>
										<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="post-thumbnail">
											<?php the_post_thumbnail('one-column-big', array('alt' => get_the_title(), 'title' => get_the_title())); ?>
										</a>
										<?php if(get_post_meta($post->ID, 'pyre_overall_score', true)): ?>
										<div class="post-score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_overall_score', true); ?>.png" alt="" /></div>
										<?php endif; ?>
									</div>
									<?php endif; ?>
									<h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
									<p class="post-meta"><?php the_time('F jS, Y'); ?>, by <?php the_author_posts_link(); ?></p>
									<p class="excerpt"><?php echo string_limit_words(get_the_excerpt(), 14); ?></p>
								</div>
								<?php else: ?>
								<div class="normal-block clearfix">
									<?php if(has_post_thumbnail()): ?>
									<div class="post-thumb-container">
										<?php
										if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
											$icon = '<span class="post-format ' . get_post_format($post->ID) . '"></span>';
										} else {
											$icon = '';
										}
										echo $icon;
										?>
										<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="post-thumbnail">
											<?php the_post_thumbnail('one-column-small', array('alt' => get_the_title(), 'title' => get_the_title())); ?>
										</a>
									</div>
									<?php endif; ?>
									<div class="post-desc">
										<h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
										<p class="post-meta"><?php the_time('F jS, Y'); ?>, by <?php the_author_posts_link(); ?></p>
										<?php if(get_post_meta($post->ID, 'pyre_overall_score', true)): ?>
										<div class="normal-post-score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_overall_score', true); ?>.png" alt="" /></div>
										<?php endif; ?>
									</div>
								</div>
								<?php endif; ?>
								<?php $count++; endwhile; ?>
							</div>
						
						</div>
					</div>
					<?php endif; ?>
					<?php endif; ?>
					
					<?php if(get_option('pyre_homepage_style') == 'blog'): ?>
					<div class="homepage-widget">
						<div class="block full archive clearfix">
					
						<h3>
							<?php _e('Recent Posts', 'Broadway'); ?>
							<span></span>
						</h3>
						
						<div class="block-content clearfix">
						<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
							<div id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
								<?php if(has_post_thumbnail()): ?>
								<div class="block-image">
									<div class="post-thumb-container clearfix">
										<?php
										if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
											$icon = '<span class="post-format-big ' . get_post_format($post->ID) . '"></span>';
										} else {
											$icon = '';
										}
										echo $icon;
										?>
										<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="post-thumbnail">
											<?php the_post_thumbnail('archive-image', array('alt' => get_the_title(), 'title' => get_the_title())); ?>
										</a>
										<?php if(get_post_meta($post->ID, 'pyre_overall_score', true)): ?>
										<div class="post-score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_overall_score', true); ?>.png" alt="" /></div>
										<?php endif; ?>
									</div>
								</div>
								<?php endif; ?>
								<div class="post-content">
									<h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
									<p class="post-meta"><?php the_time('F jS, Y'); ?>, by <?php the_author_posts_link(); ?></p>
									<p class="post-excerpt"><?php echo string_limit_words(get_the_excerpt(), 16); ?> ...</p>
									<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore orange-button"><?php _e('Read More', 'Broadway'); ?></a>
								</div>
							</div>
						<?php endwhile; endif; ?>
						</div>

						<?php kriesi_pagination($pages = '', $range = 2); ?>
						</div>
					</div>
					
					<div class='block full'>
						<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage (Blog Style)')): ?>
						<?php endif; ?>
					</div>
				<?php endif; ?>
				<!-- END HOMEPAGE BLOCKS -->
			
			</div>
			<!-- END MAIN -->
			
<?php get_sidebar(); ?>
			
<?php get_footer(); ?>