<?php
/**
 * Archive pages.
*/

get_header(); ?>

<div class="content">

    <div class="leftWidget">

		<?php if ( have_posts() ) : ?>
			<header class="archive-header">
				<h1 class="archive-title"><?php
					if ( is_day() ) :
						printf( __( 'Daily Archives: %s', 'teamRaxy' ), get_the_date() );
					elseif ( is_month() ) :
						printf( __( 'Monthly Archives: %s', 'teamRaxy' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) );
					elseif ( is_year() ) :
						printf( __( 'Yearly Archives: %s', 'teamRaxy' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) ) );
					else :
						_e( 'Archives', 'teamRaxy' );
					endif;
				?></h1>
			</header>

			<?php 
			$i = 0;
			while ( have_posts() ) : the_post(); 
              
			  $i++;
			  //$recentPosts->the_post();
			  $postsid = get_the_ID();
			  
			  /***blow line not work any thing*/
			  get_the_post_thumbnail( get_the_ID(),array(100,100) ) ;
			  /***************/
			  
			  /** get thumbnail image url of the current post*/
			 $currentPostThumbImage =  new WP_Query( array( 'post_type' => 'attachment','post_status' => 'inherit', 'post_mime_type' => 'image','post_parent' => get_the_ID()) );
		
			 
			  if($currentPostThumbImage->have_posts()){ $currentPostThumbImage->the_post();
				
			  $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'thumbnail' );
			  $imageURL = $thumb['0'];
			 			// wp_reset_query();
			/** Display only the specific post content where id = $postsid */			
			  $displaySpecificPost =  new WP_Query( array('post_type'=>'post','post__in' => array($postsid)) );
			  $displaySpecificPost->have_posts(); $displaySpecificPost->the_post();			
			 ?>
             <?php if($i % 2 != 0) { ?>
           <div class="leftText">
              <div class="post" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
              <?php teamRaxy_entry_date(); ?>
			  &nbsp;<?php edit_post_link( __( 'Edit', 'teamRaxy' ), '<span class="edit-link">', '</span>' ); ?>
              </div>
              
             
              
             <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> 
                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo $imageURL ;?>" class="leftImage"></a>
             <p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_excerpt(); ?></a>
             
             </p>
             
             <p class="smalltext">
				 <!--Tags show-->
			 <?php $tags_list = get_the_tag_list( '', __( ' | ', 'teamRaxy' ) );
				if ( $tags_list ){ ?>
				<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged:</span> %2$s', 'teamRaxy' ), 'string1,string2', $tags_list ); ?>
			</span>
			<?php } ?>
				 <!--Finish tags show-->
			 </p>
             
          </div>
                 
                 <?php }else{ ?>
          <div class="leftText">
              <div class="post" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
              <?php teamRaxy_entry_date(); ?>
			  &nbsp;<?php edit_post_link( __( 'Edit', 'teamRaxy' ), '<span class="edit-link">', '</span>' ); ?>
              </div>
              
             
              
               <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>              
                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo $imageURL ;?>" class="rightImage"></a>
				<p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_excerpt(); ?></a></p>
          
          <p class="smalltext">
				 <!--Tags show-->
			 <?php $tags_list = get_the_tag_list( '', __( ' | ', 'teamRaxy' ) );
				if ( $tags_list ){ ?>
				<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged:</span> %2$s', 'teamRaxy' ), 'string1,string2', $tags_list ); ?>
			</span>
			<?php } ?>
				 <!--Finish tags show-->
			 </p>
             
          </div>
                
                <?php   } //end of else  
				
						  } // end of if $currentPostThumbImage->have_posts()
					 	?>
                        
            <!--<h2 class="entry-title"><a href="<?php //the_permalink(); ?>" title="<?php //printf( esc_attr__( 'Permalink to %s', 'education' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php //the_title(); ?></a></h2>-->
			<?php endwhile; ?>


		<?php else : ?>
		<?php endif; ?>

		</div>
	</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>