<?php

/*
Template Name: Property Listing
*/
get_header();
/* Site Showcase */
imic_page_banner($pageID = get_the_ID());
/* End Site Showcase */
$sidebar = get_post_meta(get_the_ID(), 'imic_select_sidebar_from_list', false);
$design_type = get_post_meta(get_the_ID(), 'imic_property_design_layout', true);
$class = empty($sidebar) || !is_active_sidebar($sidebar[0]) ? 12 : 9;
$div = $design_type == 'grid' ? '<div class="property-grid"><ul id="property_grid_holder" class="grid-holder col-3">' : '<div class="property-listing row"><ul class="col-md-12" id="property_grid_holder">';
$layout = $design_type == 'grid' ? '<i class="fa fa-th-large"></i></span>' . __('Property Grid', 'framework') . '' : '<i class="fa fa-th-list"></i></span>' . __('Property Listing', 'framework');
$listing_layout_url = get_post_meta(get_the_ID(), 'imic_property_listing_url', true);
$grid_layout_url = get_post_meta(get_the_ID(), 'imic_property_grid_url', true);
$listing_url = $design_type == 'listing' ? $listing_layout_url : '';
$grid_url = $design_type == 'grid' ? $grid_layout_url : '';
$listing_class = $design_type == 'listing' ? 'active' : '';
$grid_class = $design_type == 'grid' ? 'active' : '';
?>
<!-- Start Content -->
  <div class="main" role="main">
      <div id="content" class="content full">
          <div class="container">
              <div class="row">
           <div class="col-md-<?php 
echo $class;
?>
">
                      <div class="block-heading">
<?php

/*
Template Name: Blog
*/
get_header();
$page_for_posts = get_option('page_for_posts');
//check by Blog
if (is_home() && !empty($page_for_posts)) {
    $blog_id = $page_for_posts;
} else {
    $blog_id = get_the_ID();
}
/* Site Showcase */
imic_page_banner($pageID = $blog_id);
/* End Site Showcase */
$blog_type = get_post_meta($blog_id, 'imic_blog_type', true);
$sidebar = get_post_meta($blog_id, 'imic_select_sidebar_from_list', false);
$class = empty($sidebar) || !is_active_sidebar($sidebar[0]) ? 12 : 9;
$blog_classes_open = $blog_type == 'masonry' ? '<div class="row"><div class="col-md-' . $class . '"><ul class="grid-holder col-3">' : '<ul class="timeline">';
$blog_classes_close = $blog_type == 'masonry' ? '</ul></div>' : '</ul>';
?>
<!-- Start Content -->
  <div class="main" role="main">
    <div id="content" class="content full">
      <div class="container">
        <?php 
echo $blog_classes_open;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
query_posts(array('post_type' => 'post', 'paged' => $paged));
if (have_posts()) {