<?php
/**
 * The main template file.
 

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(" - ", $array);

echo '<br />'.$comma_separated; // lastname,email,phone

$comma_separated = explode(" - ", $comma_separated);

echo '<br />'.$comma_separated[2]; // lastname,email,phone
echo '<br />';
var_dump ($comma_separated);

// Empty string when using an empty array:
//var_dump(implode('hello', array())); // string(0) ""

*/


get_header();
$options = get_option('cOptn');
 
?>

  <div class="home-box">
 	<ul>
   <?php $index_query = new WP_Query(array( 'post_type' => 'homeboxes', 'posts_per_page' => 3, 'order' => "ASC" )); ?>
<?php while ($index_query->have_posts()) : $index_query->the_post(); ?>
 			<li>
 				<div class="left-box"><?php the_post_thumbnail(); ?></div>
                <h2><?php the_title(); ?></h2>
                 <p><?php 
		  $content = get_the_content();
		echo showBrief($content,15);
?>
</p>
<?php  $key="link"; 
$links = get_post_meta($post->ID, $key, true); ?>
<a href="<?php echo $links;  ?>" class="box-link">Click here to view detail</a>
 	
 			</li>
 
 <?php endwhile; wp_reset_postdata(); ?>
 	</ul>
    <Div class="clear"></Div>
 </div> <!-- end home boxes -->
     
  <div class="leftarea">
  
  <div class="welcome">
  
	<?php $welcome = new WP_Query( 'category_name=welcome&showposts=1&order=ASC' ); ?>  
    <?php while( $welcome->have_posts() ) : $welcome->the_post();  ?>
        <h2><?php the_title(); ?></h2>
        <?php the_content(); ?>
    <?php endwhile; wp_reset_query(); ?>

  </div>
  
  <div class="featured-product">
  <h2>Featured <span>Projects</span></h2>
  
  <ul>
  
  <?php  $index_query = new WP_Query(array( 'post_type' => 'featured', 'posts_per_page' => 3 )); ?>
  <?php while ($index_query->have_posts()) : $index_query->the_post(); ?>
  
  <li>
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
  
  
  <?php global $more; $more=0; ?>
  <?php   the_content('Read more'); ?>
  <p><?php multiColor(get_the_title(),2); ?></p>
  </li>
  <?php endwhile; wp_reset_query(); ?>
  </ul>
  </div>
  
  <div class="clear"></div>
  </div>
  
  <div class="right-area">
  <div class="qoute"><h4> Need Consultant support?</h4>
  <h2>Get a Free Qoute </h2>
  <h3>Call us At : <?php echo $options['phone_num'] ; ?></h3>
  </div>
  <div class="seprator"></div>
  <div class="news">
  <h2>News &amp; <span>Updates</span></h2>
       
  <?php  $index_query = new WP_Query(array( 'post_type' => 'newsevents', 'posts_per_page' => 2 )); ?>
  <?php while ($index_query->have_posts()) : $index_query->the_post(); ?>
 
  <div class="news-loop">
    <p><?php 
  $content = get_the_content();
  echo showBrief($content,10);
  ?>
  </p>
  <div class="date">
    <?php the_time('F j, Y'); ?>
  </div>
  </div>
  <?php endwhile; wp_reset_postdata(); ?>
       
  </div>
  
  </div>
  
  
<?php get_footer();  ?>