<?php get_header(); ?>
			<?php if(get_option('reedwan_sidebar_position') == 'left'): ?>
			<!-- Begin Left Sidebar -->
			<div class="left-sidebar grid_4">	
				<?php get_sidebar(); ?>
			</div>
			<!-- End Left Sidebar -->
			<?php endif; ?>
			
			<!-- Begin Content -->
			<div class="single-container grid_8" >
			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
				<!-- Begin Single Content -->
				<div class="single-block">
					<div class="single-title-wrap">
					<?php echo '<div class="' . get_post_format() . '-post-icon"></div>'; ?>
					<div class="single-title">
						<h1><?php the_title(); ?></h1>	
						<div class="single-info">
							<span class="single-author"><?php the_author(); ?></span> 
							<span class="single-date"><?php the_date(); ?></span>
							<?php if(get_option('reedwan_categories') == 'On'): ?> 
							<span class="single-category"><?php the_category(', ') ?></span>
							<?php endif; ?>
							<span class="single-comment"><?php comments_popup_link(); ?></span>
						</div>	
					</div>
					</div>
					<div class="clear"></div>
					<div class="single-content">
					<?php if(has_post_thumbnail()): ?>
						<?php if(get_post_meta($post->ID, 'reedwan_featured_image', true) == 'yes'): ?>
							<div class="single-thumb">
								<?php $thumbFeatured = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-thumb'); ?>
								<?php $fullFeatured= wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full-featured-thumb'); ?>
								<a class='lightbox preview-icon' href='<?php echo $fullFeatured[0]; ?>'><img class="fadeover" src="<?php echo $thumbFeatured[0]; ?>" alt="<?php the_title(); ?>" width='620' height='270' /></a>
							</div>
						<?php endif; ?>
					<?php endif; ?>
						<?php the_content(); ?>
					<div class='clear'></div>
					
					<?php if(get_option('reedwan_tags') == 'On'): ?> 
					<!-- Begin Tag -->
						<div class="tagcloud"><?php the_tags('','',''); ?></div>
					<!-- End Tag -->
					<?php endif; ?>
					</div>
				</div>
				<!-- End Single Content -->
				<div class="clear"></div>
				<?php get_template_part('includes/share'); ?>
				
				<?php if(get_option('reedwan_author') == 'On'): ?> 
				<!-- Begin Author Information -->
				<div class="author-information">
					<div class="line-title"><h3><?php _e('About The Author', 'Backstreet'); ?></h3></div>
					<div class="clear"></div>
					<div class="author-description">
						<?php echo get_avatar(get_the_author_meta('email'), '70'); ?>
						<div class="description-author">
						<div class="author-title">
							<?php the_author_posts_link(); ?>
						</div>
						<?php if(get_the_author_meta('twitter') || get_the_author_meta('facebook')|| get_the_author_meta('google_plus') || get_the_author_meta('flickr')): ?>
						<div class="author-social">
							<?php if(get_the_author_meta('twitter')): ?>
							<a class="author-twitter" href='http://twitter.com/<?php echo get_the_author_meta('twitter'); ?>'></a>
							<?php endif; ?>
							<?php if(get_the_author_meta('facebook')): ?>
							<a class="author-facebook" href='http://facebook.com/<?php echo get_the_author_meta('facebook'); ?>'></a>
							<?php endif; ?>
							<?php if(get_the_author_meta('google_plus')): ?>
							<a class="author-google" href='http://plus.google.com/<?php echo get_the_author_meta('google_plus'); ?>'></a>
							<?php endif; ?>
							<?php if(get_the_author_meta('flickr')): ?>
							<a class="author-flickr" href='http://www.flickr.com/photos/<?php echo get_the_author_meta('flickr'); ?>'></a>
							<?php endif; ?>
						</div>
						<?php endif; ?>
						<div class="clear"></div>
						<p><?php the_author_meta("description"); ?></p>
						
						</div>
					</div>
				</div>
				<!-- End Author Information -->
				<?php endif; ?>
				<div class="clear"></div>
				<?php $tags = get_the_tags(); ?>
				<?php if($tags): ?>
				<?php $related = get_related_posts($post->ID, $tags); ?>
				<?php if($related->have_posts() && $related->found_posts >= 1 && get_option('reedwan_related') == 'On'): ?>
					<!-- Begin Related Post -->
					<div class="related-wrapper">
						<div class="line-title"><h3><?php _e('Related Post ', 'Backstreet'); ?></h3></div>			
						<div class="clear"></div>
						<div class="related-item-wrapper">
							<?php while($related->have_posts()): $related->the_post(); ?>
								<?php
									if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) 
									{
										$format_icon = 'class="' . get_post_format() . '-format-icon"';
									}
									else {
										$format_icon = 'class="standard-format-icon"';
									}
								?>
								<?php if(has_post_thumbnail()): ?>
									<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'related-thumb'); ?>
									<div class="related-post">
										<div class="related-post-image"><a <?php echo $format_icon; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img class="fadeover" src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='140' height='90' /></a></div>
										<h6><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h6>
									</div>
								<?php else: ?>
									<div class="related-post">
										<div class="related-post-image"><a <?php echo $format_icon; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img class="fadeover" src="<?php echo get_template_directory_uri(); ?>/timthumb.php?src=<?php echo get_template_directory_uri(); ?>/images/thumbnail.png&w=140&h=90" alt="<?php the_title(); ?>" width='140' height='90' /></a></div>
										<h6><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h6>
									</div>
								<?php endif; ?>
								
								
							<?php endwhile; ?>
						</div>
					</div>
					<!-- End Related Post -->
				<?php endif; ?>
				<?php endif; ?>
				<?php wp_reset_query(); ?>
				<div class="clear"></div>
				<!-- Begin Comments -->
				<div id="comments">
					<?php comments_template(); ?>
				</div>
				<!-- End Comments -->
				<div class='clear'></div>
				
				<?php if(get_option('reedwan_single_navigation') == 'On'): ?>
					<!-- Begin Navigation -->
					<div class="post-nav">
						<div class="nav-left" ><?php previous_post_link('%link', '&larr; Previous post'); ?> </div>
						<div class="nav-right" ><?php next_post_link('%link', 'Next post &rarr;'); ?></div>
					</div>
					<!-- End Navigation -->
				<?php endif; ?>
				
			<?php endwhile; endif; ?>
			</div>
			<!-- End Content -->
			
			<?php if(get_option('reedwan_sidebar_position') == 'right'): ?>
			<!-- Begin Right Sidebar -->
			<div class="right-sidebar grid_4">	
				<?php get_sidebar(); ?>
			</div>
			<!-- End Right Sidebar -->
			<?php endif; ?>
			
<?php get_footer(); ?>