<?php
$parallax_settings = get_option( 'parallax_options');
get_header(); 
?>
<div class="wrapper">	
	<div id="content">

	
		<div class="sticky-container">
		

	<?php if (have_posts()) { ?>
<?php	$args = array(  
    'post__in'  => get_option('sticky_posts'),  
    'ignore_sticky_posts' => 1,

); ?>
<?php $query1 = new WP_Query($args); ?>
	<?php $i = 0; ?>
	<?php $per_column = ceil($posts_per_page / 2); ?>
	<?php if ($query1->post_count <= $posts_per_page) $per_column = ceil($query1->post_count / 2); ?>

			<div class="column">
<?php while($query1->have_posts()){ $query1->the_post(); $i++; ?>	
 <?php if( is_sticky() )  { ?>
				<div class="post"id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php if (trim(get_the_title()) != '') { the_title(); } else  _e('No title', 'parallax'); ?></a></h2>
<div class="single-post-image"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('sticky-feature', array('alt' => '', 'title' => '')) ?></a></div>			
						
							<div class="entry"><?php the_excerpt() ?></div></a>
				</div><!-- .post -->

		<?php if ($i == $per_column) { ?>
			</div><!-- .column -->

			<div class="column right">
		<?php } ?>

	<?php } ?>
		<?php } ?>

			</div><!-- .column -->

			<div class="clear"></div>

			
	<?php } ?>
	<?php	wp_reset_postdata();  ?>
</div>		
	
		
		<div class="index-posts">
	<?php if (have_posts()) { ?>
<?php
$current_page = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$args = array(
'paged' => $current_page,	
    'post__not_in'  => get_option( 'sticky_posts' )  

); ?>
<?php $query2 = new WP_Query($args); ?>
	<?php $i = 0; ?>
	<?php $per_column = ceil($posts_per_page / 2); ?>
	<?php if ($query2->post_count <= $posts_per_page) $per_column = ceil($query2->post_count / 2); ?>

			<div class="column">
<?php while($query2->have_posts()){ $query2->the_post(); $i++; ?>	
 <?php if( !is_sticky() )  { ?>
				<div class="single-post">
					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php if (trim(get_the_title()) != '') { the_title(); } else  _e('No title', 'parallax'); ?></a></h2>
<div class="single-post-image"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumb-feature', array('alt' => '', 'title' => '')) ?></a></div>			
						
							<div class="entry"><?php the_excerpt() ?></div></a>
				</div><!-- .post -->

		<?php if ($i == $per_column) { ?>
			</div><!-- .column -->

			<div class="column right">
		<?php } ?>

	<?php } ?>
		<?php } ?>

			</div><!-- .column -->

			<div class="clear"></div>

			
	<?php } ?>
	<?php	wp_reset_postdata();  ?>
					

	<div class="clear"></div>
				<div class="posts-navigation">
<div id="nav"><?php if (function_exists('parallax_wp_corenavi')) parallax_wp_corenavi(); ?></div>
					<div class="clearfix"></div>
				</div>	
		
	</div><!-- index-posts -->

<div class="bottom-widget">
<div class="sb-right">
    <?php if ( is_active_sidebar( 'sidebar-posts' ) ) : ?>
	    <?php dynamic_sidebar( 'sidebar-posts' ); ?>
    <?php endif; ?>
</div>
</div>
	<div class="clear"></div>
	<?php 
	include get_template_directory() . '/featured-posts.php'; ?>
	<div class="clearfix"></div>		

</div><!-- content -->
</div><!-- wrapper -->
<div class="clear"> </div>
<?php get_footer(); ?>