<?php
	/**
	 * search.php
	 * The main post loop in Ainex
	 * @author Vu Ngoc Linh
	 * @package Ainex
	 * @since 1.0.0
	**/
	$post = new stdClass();
	$args = array( 'posts_per_page' => 1, 'offset'=> 1,);
	$myposts = get_posts( $args );
	foreach ($myposts as $value) {
		$post->ID = $value->ID;
	}
	wp_reset_postdata();
	get_header();
	global $ainex;
?>

    <div class="page_title">
      <div class="container">
        <div class="title">
          <h1><?php echo sprintf( __('Your Search For:','themestudio') . ' %s', get_search_query()); ?></h1>
        </div>
        <div class="pagenation"><?php ts_breadcrumbs(); ?></div>
      </div>
    </div>
	
	<div class="container">
		
		<?php 
			if(isset($ainex['blog_page_layout'])){
				$blog_page_layout = $ainex['blog_page_layout'];
			} else {
				$blog_page_layout = 'fulwidth';
			}
			switch ($blog_page_layout) {
				case 'fulwidth':
				if(isset($ainex['blog_style'])){
					$blog_style = $ainex['blog_style'];
				} else {
					$blog_style = 'list';
				}
		?>
			<div class="content_fullwidth">
		    	<?php get_template_part('loop/loop', 'blog'.$blog_style );  ?>
		    </div>
		    <!-- end content full width area -->
		<?php
				break;

				case 'left-sidebar':
		?>
			
			<!-- left sidebar starts -->
		    <div class="left_sidebar">
		    	<?php get_sidebar( 'left' ); ?>
		    </div>
		    <div class="content_right">
		    	<?php get_template_part('loop/loop', 'blog'.$ainex['blog_style'] );  ?>
		    </div>
		    <!-- end content left side area -->
		<?php
				break;
				
				default:
		?>
			<div class="content_left">
				<?php get_template_part('loop/loop', 'blog'.$ainex['blog_style']); ?>
		    </div>
		    <!-- end content left side area -->
			<!-- right sidebar starts -->
		    <div class="right_sidebar">
		    	<?php get_sidebar( 'right' ); ?>
		    </div>
		<?php
				break;
			}
		?>
	</div>

<?php get_footer();