<?php
/**
 * @package WordPress
 * @subpackage Classic_Theme
 */
get_header();
?>


<div id="container-wrap"><div id="container-bottom" class="clearfix">
		<div id="content">
			<!-- Gallery Start -->
		<?php include(TEMPLATEPATH . '/gallery.php'); ?>
		<div class="clear"></div>
	<!-- Gallery End -->
		<?php
			if(wpthemes_options('home_cat1') != '' && wpthemes_options('home_cat1_num') > 0 && wpthemes_options('home_cat1') <> 'none') {
			?>
			<?php $cat = get_category(wpthemes_options('home_cat1')); ?>
			<?php $recent = new WP_Query("cat=".wpthemes_options('home_cat1')."&showposts=".wpthemes_options('home_cat1_num'));?>
				<div id="featured_category1" class="clearfix">
						<div class="home-title"><a href="<?php echo get_category_link(wpthemes_options('home_cat1')); ?>" rel="bookmark"><?php echo wpthemes_options('home_cat1_text'); ?></a></div>
					<?php if (have_posts()) : ?>
						<?php while($recent->have_posts()) : $recent->the_post(); ?>
					
					<div class="category">
						<div class="post"><div class="post-top"><div class="post-bottom clearfix">
							<div class="entry">
								<a href="<?php the_permalink(); ?>"><?php include(TEMPLATEPATH . '/thumbnail.php'); ?></a>
								<div class="clear"></div>
								<p><?php wpthemes_post_content(170, 1, ''); ?></p>
								<div class="more"><a href="<?php the_permalink() ?>">Read More</a></div>
							</div>
						</div></div></div>
					</div>
						<?php endwhile; ?>
					<?php else : ?>
						<div class="notfound"><p>Content Not Found!</p><p>Please try again.</p></div>
					<?php endif; ?>
					</div>
		<?php } ?>

		<div class="post_wrapper">
        	<?php
		if(wpthemes_options('featured_articles_enable') != '' && wpthemes_options('featured_articles_num') > 0) {
		?>
			<?php $paged = (get_query_var('paged')); ?>
			<?php query_posts("cat=" . wpthemes_options('featured_articles') . "&paged=" . $paged . "&showposts=" . wpthemes_options('featured_articles_num')); ?>
        	
				<?php if (have_posts()) : ?>
					<?php while (have_posts()) : the_post(); ?>
						<?php if ( version_compare( $wp_version, '2.7', '>=' ) ) { ?>
							<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
							<?php } else { ?>
							<div id="post-<?php the_ID(); ?>" class="post post-<?php the_ID(); ?>">
						<?php } ?>
								
									<h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
									<div class="post-data">
										<span class="post-date"><span class="num"><?php the_time(d); ?></span><br /><?php the_time(M); ?> </span> Author: <a href="<?php the_author() ?>" title="<?php the_author() ?>"><?php the_author() ?></a>&nbsp;&nbsp;&nbsp;&nbsp;Category: <?php the_category(', ') ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php if(get_the_tags()) { ?><?php  the_tags('Tags: ', ', '); } ?>&nbsp;&nbsp;&nbsp;&nbsp;Comments: <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
									</div>
									<?php include(TEMPLATEPATH . '/thumbnail.php'); ?>
									<?php the_content(''); ?>
									<div class="clear"></div>
									<div class="more-link"><a href="<?php the_permalink() ?>">Read More</a></div>
							</div>
			<?php endwhile; ?>
			<?php else : ?>
				<div class="notfound"><p>Content Not Found!</p><p>Please try again.</p></div>
			<?php endif; ?>
            <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
				<div class="wp-pagenavi">
				<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
				<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
				</div>
			<?php } ?>
            </div>
            <?php } ?>
		<?php wp_reset_query(); ?>
        </div>
		<?php get_sidebar(); ?>
	</div>
</div>
<?php get_footer(); ?>
