<?php
/* 
* Theme: PREMIUMPRESS CORE FRAMEWORK FILE
* Url: www.premiumpress.com
* Author: Mark Fail
*
* THIS FILE WILL BE UPDATED WITH EVERY UPDATE
* IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
*
* http://codex.wordpress.org/Child_Themes
*/
if (!defined('THEME_VERSION')) {	header('HTTP/1.0 403 Forbidden'); exit; }

global $CORE;
 
// GET HOME PAGE CUSTOM DATA
$HDATA = $GLOBALS['CORE_THEME']['hdata'];

// CATEGORIES
$i=1;
$args = array(
				  'taxonomy'     => THEME_TAXONOMY,
				  'orderby'      => 'count',
				  'order'		=> 'desc',
				  'show_count'   => 1,
				  'pad_counts'   => 0,
				  'hierarchical' => 0,
				  'title_li'     => '',			 
				  'hide_empty'   => 0,				 
); 
$categories = get_categories($args); 
 
// HEADER
get_header($CORE->pageswitch()); 

?> 
<?php if(!isset($GLOBALS['CORE_THEME']['home_section1']) || (isset($GLOBALS['CORE_THEME']['home_section1']) && $GLOBALS['CORE_THEME']['home_section1'] == '1' ) ){  ?>
 
<?php if(isset($GLOBALS['CORE_THEME']['homesliderid']) && $GLOBALS['CORE_THEME']['homesliderid'] != "" && $GLOBALS['CORE_THEME']['homeslider'] == 1 ){  

echo do_shortcode(stripslashes("[rev_slider ".$GLOBALS['CORE_THEME']['homesliderid']."]")); 

}else{ ?>

<div class="row">
<div class="col-md-8 hidden-xs">

<div class="jumbostyle1 homelayout1 cols<?php echo $GLOBALS['CORE_THEME']['layout_columns']['homepage']; ?>" <?php if(isset($HDATA['j1']['img']) && $HDATA['j1']['img'] != ""){ echo 'style="background-image: url(\''.$HDATA['j1']['img'].'\');"'; } ?>>

    <div class="jumbotron">
    
    <div class="inner">
            
            <h1><?php echo stripslashes($HDATA['j1']['title1']); ?></h1>
            
            <h2><?php echo stripslashes($HDATA['j1']['title2']); ?></h2>
            
            <?php echo wpautop(stripslashes($HDATA['j1']['title3'])); ?> 
            
            <a href="<?php echo home_url(); ?>/?s=" class="btn btn-lg btn-primary"><?php echo $CORE->_e(array('button','60')); ?></a> 
    </div>
     
    </div>

</div> 

</div> 


<div class="col-md-4">

<ul class="home_box1">

<li style="background:url(<?php echo stripslashes($HDATA['j1']['img1']); ?>);">
<div><h3><?php echo stripslashes($HDATA['j1']['stxt1']); ?></h3><span><?php echo stripslashes($HDATA['j1']['sdesc1']); ?></span>
<a href="<?php echo stripslashes($HDATA['j1']['slink1']); ?>" class="btn btn-primary btn-small"><?php echo $CORE->_e(array('checkout','59')); ?></a> </div></li>

<li style="background:url(<?php echo stripslashes($HDATA['j1']['img2']); ?>);">
<div><h3><?php echo stripslashes($HDATA['j1']['stxt2']); ?></h3><span><?php echo stripslashes($HDATA['j1']['sdesc2']); ?></span>
<a href="<?php echo stripslashes($HDATA['j1']['slink2']); ?>" class="btn btn-primary btn-small"><?php echo $CORE->_e(array('checkout','59')); ?></a>  </div></li>

<li style="background:url(<?php echo stripslashes($HDATA['j1']['img3']); ?>);">
<div><h3><?php echo stripslashes($HDATA['j1']['stxt3']); ?></h3><span><?php echo stripslashes($HDATA['j1']['sdesc3']); ?></span>
<a href="<?php echo stripslashes($HDATA['j1']['slink3']); ?>" class="btn btn-primary btn-small"><?php echo $CORE->_e(array('checkout','59')); ?></a>  </div></li>

</ul>

</div>
</div>

<div class="clearfix"></div> 

<?php } ?> 

<?php } ?>
 


<?php if(!isset($GLOBALS['CORE_THEME']['home_section2']) || (isset($GLOBALS['CORE_THEME']['home_section2']) && $GLOBALS['CORE_THEME']['home_section2'] == '1' ) ){  ?> 

<div id="car1" class="owl-carousel wlt_search_results grid_style style1">
<?php echo do_shortcode('[LISTINGS dataonly=1 show=8 query="meta_key=featured&meta_value=yes"]'); ?> 
</div>

<script>
jQuery(document).ready(function() { 
  jQuery("#car1").owlCarousel({ items : 4, autoPlay : true,  }); 
});
</script>

<?php } ?>





 







<?php if(!isset($GLOBALS['CORE_THEME']['home_section4']) || (isset($GLOBALS['CORE_THEME']['home_section4']) && $GLOBALS['CORE_THEME']['home_section4'] == '1' ) ){  ?>

<hr />
 
<div class="tabstyle1 hidden-xs"> 

  <ul class="nav nav-tabs " role="tablist">
  
    <li role="presentation" class="active"><a href="#t1" aria-controls="t1" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-transfer" aria-hidden="true"></span> Latest Products</a></li>
    
    <li role="presentation"><a href="#t2" aria-controls="t2" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-headphones" aria-hidden="true"></span> Best Sellers</a></li>
    
    <li role="presentation"><a href="#t3" aria-controls="t3" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-gift" aria-hidden="true"></span> Mosted Viewed</a></li>

   <li role="presentation"><a href="#t4" aria-controls="t4" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Featured</a></li>

  </ul>

</div>

<?php $GLOBALS['item_class_size'] = "col-md-3  col-sm-3 "; ?> 
<div class="tab-content">
  
    <div role="tabpanel" class="tab-pane active" id="t1">   
	
        <div class="row wlt_search_results grid_style" style="margin-top:20px;">
        <?php echo do_shortcode('[LISTINGS dataonly=1 show=8 custom="new"]'); ?> 
        </div>
    
    </div>
    <div role="tabpanel" class="tab-pane" id="t2">   
	
        <div class="row wlt_search_results grid_style" style="margin-top:20px;">
        <?php echo do_shortcode('[LISTINGS dataonly=1 show=8  custom="random"]'); ?> 
        </div>
    
    </div>
    <div role="tabpanel" class="tab-pane" id="t3">   
	
        <div class="row wlt_search_results grid_style" style="margin-top:20px;">
        <?php echo do_shortcode('[LISTINGS dataonly=1 show=8  custom="popular"]'); ?> 
        </div>
    
    </div>
    <div role="tabpanel" class="tab-pane" id="t4">   
	
        <div class="row wlt_search_results grid_style" style="margin-top:20px;">
        <?php echo do_shortcode('[LISTINGS dataonly=1 show=8 custom="featured"]'); ?> 
        </div>
    
    </div>

  </div>
  
 <script>
jQuery(document).ready(function(){  
 
	setTimeout(function(){equalheight('.grid_style .thumbnail');  }, 2000); 

	jQuery('.nav-tabs a').on( "click", function() {
	setTimeout(function(){equalheight('.grid_style .thumbnail');  }, 1000); 
	});
 
});
 
</script> 

<?php } ?>

 


<?php if(!isset($GLOBALS['CORE_THEME']['home_section3']) || (isset($GLOBALS['CORE_THEME']['home_section3']) && $GLOBALS['CORE_THEME']['home_section3'] == '1' ) ){  ?>
 
<hr /> 
 
<div class="row hidden-xs">

    <div class="col-md-4">
        <img src="<?php echo stripslashes($HDATA['t3']['img1']); ?>" alt="img1" class="img-responsive hf1" />
    </div>
    <div class="col-md-4">
        <img src="<?php echo stripslashes($HDATA['t3']['img2']); ?>" alt="img2" class="img-responsive hf2" />
    </div> 
    <div class="col-md-4">
        <img src="<?php echo stripslashes($HDATA['t3']['img3']); ?>" alt="img2" class="img-responsive hf3" />
    </div> 
    
</div> 

<hr /> 

<?php } ?>
 
 
 
<?php get_footer($CORE->pageswitch()); ?>