<?php get_header(); 

global $gp_settings;

?>

<?php $main_query = new WP_Query($query_string); if ($main_query->have_posts()) : while ($main_query->have_posts()) : $main_query->the_post(); ?>
    <?php if (in_category('dedication')) { $is_video = true; ?>
        <?php require_once('single-video.php'); ?>
    <?php } ?>
<?php endwhile; endif; ?>
<?php wp_reset_query(); ?>

<?php if (!$is_video) { ?>
<div id="content">

	<?php $main_query = new WP_Query($query_string); if ($main_query->have_posts()) : while ($main_query->have_posts()) : $main_query->the_post(); ?>
	
		<?php if($gp_settings['post_type'] == "Review") { ?>
		
			<?php require_once('single-review.php'); ?>

		<?php } elseif($gp_settings['post_type'] == "Image Gallery") { ?>
		
			<?php require_once('single-image-gallery.php'); ?>
					
		<?php } else { ?>
		
			<?php if($gp_settings['title'] == "Show") { ?><h1><?php the_title(); ?></h1><?php } ?>

			<?php require_once('post-meta.php'); ?>
					
			<!--Begin Image-->
			<?php if(has_post_thumbnail() && $gp_settings['show_image'] == "Show") { ?>	
				<div class="post-thumbnail<?php if($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
					<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
					<img src="<?php echo $image[url]; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?>" />			
				</div>
				
				<?php if($gp_settings['image_wrap'] == "Disable") { ?><div class="clear"></div><?php } ?>
				
			<?php } ?>
			<!--End Image-->
			
			<div id="post-content">
				<?php the_content(); ?>
			</div>
					
			<?php wp_link_pages('before=<div class="clear"></div><div class="wp-pagenavi post-navi">&pagelink=<span>%</span>&after=</div>'); ?>		

			<?php if($gp_settings['author_info'] == "0") { ?><div class="clear"></div><?php echo do_shortcode('[author]'); } ?>
		
			<?php if($gp_settings['related_items'] == "0") { require('related-items.php'); } ?>
		
			<?php comments_template(); ?>

		<?php } ?>	

	<?php endwhile; endif; ?>

</div>
<?php } ?>


<?php get_sidebar(); ?>

<?php get_footer(); ?>