<?php 
/*
Template Name: Page List
*/
get_header();

global $gp_settings;

?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
									
	<?php if($gp_settings['title'] == "Show") { ?><h1 class="page-title"><?php the_title(); ?></h1><?php } ?>
			
	<div id="content">

		<!--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-->
			
		<?php
		$children = wp_list_pages('depth=1&title_li=&child_of='.$post->ID.'&echo=0');
		if ($children) { ?>
		<ul class="gp-list">
			<?php echo $children; ?>
		</ul>
		<?php } ?>
				
		<?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 comments_template(); ?>

	</div>

	<?php get_sidebar(); ?>

<?php endwhile; endif; ?>

<?php get_footer(); ?>