<?php
/*
Template name: customposttype Example
*/
?>
<?php get_header(); ?>

<div class="ab">
<?php $index_query = new WP_Query('post_type=proj&showposts=4'); ?>
<?php $index=1 ?>
<?php while ($index_query->have_posts()) : $index_query->the_post(); ?>
<?php if($index % 4 == 0) {?>
<div class="abbl abbl_last">
  <?php } else { ?>
  <div class="abbl">
    <?php } ?>
    <div class="abbl_img">
      <?php the_post_thumbnail('full'); ?>
    </div>
    <div class="abbl_con">
      <div class="abbl_wrap">
        <div class="abbl_title">
          <h2>
            <?php the_title(); ?>
          </h2>
        </div>
        <div class="abbl_bl">
          <div class="style">
            <?php 
						//	$con = get_the_excerpt();
						//	$result = implode(array_slice(explode('<br>',wordwrap($con,110,'<br>',false)),0,1));
						//	echo $result;
                         //   if($result!=$con)echo'.';
						 //the_content();
						 $content = get_the_content();
						 //$content = strip_tags($content);
						 echo substr($content, 0, 169);
						 
							?>
          </div>
        </div>
        <div class="abbl_more"><a href="javascript:;" class="more-arrow" title="<?php the_title(); ?>">Read more</a><br class="clear" />
        </div>
      </div>
    </div>
  </div>
  <?php $index++ ?>
  <?php endwhile; ?>
  <div class="clear"></div>
</div>
<div class="colums">
  <div class="lc">
    <div class="pro">
      <?php //$index_query = new WP_Query(''); ?>
      <?php //$index=0 ?>
      <?php ?>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post();  ?>
      <div class="pro_bl pro_bl_<?php echo $index ?>">
        <div class="title">
          <h2>
            <?php the_title(); ?>
          </h2>
        </div>
        
        <div class="pro_con">
          <div class="style">
            <?php global $more; $more=0; the_content('read more'); ?>
            <div class="clear"></div>
          </div>
        </div>
      </div>
      <?php $index++ ?>
      <?php endwhile; else: ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        <?php endif; ?>
    </div>
  </div>
  <div style="display:none">
 	 <div class="rc">
    <div class="rc_wrap">
      <div class="stand">
        <div class="title">
          <h2>Latest News</h2>
        </div>
        <?php $index_query = new WP_Query('post_type=post&showposts=4'); ?>
        <?php while ($index_query->have_posts()) : $index_query->the_post(); ?>
        <div class="st">
          <div class="st_left">
            <?php the_time('d'); ?>
          </div>
          <div class="st_right">
		  			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="st_right_link">asdasd</a>
            <div class="st_top">
              <?php the_time('F, Y'); ?>
           </div>
            <div class="st_con">
              <div class="style">
                <?php 
							$con = get_the_excerpt();
							$result = implode(array_slice(explode('<br>',wordwrap($con,50,'<br>',false)),0,1));
							echo $result;
                            if($result!=$con)echo'...';
							?>
              </div>
            </div>
          </div>
          <div class="clear"></div>
        </div>
        <?php endwhile; ?>
        <div class="stand_more"><a href="<?php bloginfo('url'); ?>?page_id=9" class="more-arrow" title="Read more">Read more</a><br class="clear" />
        </div>
      </div>
    </div>
  </div>
  </div>
  
  <div class="clear"></div>
</div>
<div class="ab_txt">

<?php get_footer(); ?>
