File: /home/imensosw/www/imenso.co/dev/titan-boards/wp-admin/front-page.php
<?php /* Template Name: Home-template */ get_header();?>
<?php
global $post;
$main_img = getSrcAltImage($post->ID);
//$fields = get_fields($post->ID);
//$allproduct_url = get_permalink(157);
?>
<div style="display: none;">
<?php while ( have_posts() ) : the_post(); ?>
<h1><?php the_field('shortcode1'); ?></h1>
<img src="<?php the_field('hero_image'); ?>" />
<p><?php the_content(); ?></p>
<?php endwhile; // end of the loop. ?>
</div>
<?php
$type="design"; $type1="Design Your Own";
if(isset($_GET['type']) && $_GET['type']!="design")
{
$type=$_GET['type'];
$type1="Fast Ship";
}
?>
<!-- banner section starts -->
<div class="banner margin-top" id="banner">
<div class="swiper-banner">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="banner_content">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-5">
<h2 class="title">WHITEBOARDS</h2>
<h1>Get Custom Whiteboards</h1>
<p>When it comes to shopping for your home, office or school.</p>
<a href="<?php echo get_bloginfo('url') ?>/product-category/" class="btn btn-primary">Shop Now</a>
</div>
</div>
</div>
</div>
<img src="<?php bloginfo('template_url'); ?>/images/banner.jpg" alt="banner" />
</div>
<div class="swiper-slide">
<div class="banner_content">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-5">
<h2 class="title">WHITEBOARDS</h2>
<h1>Get Custom Whiteboards</h1>
<p>When it comes to shopping for your home, office or school.</p>
<a href="<?php echo get_bloginfo('url') ?>/product-category/" class="btn btn-primary">Shop Now</a>
</div>
</div>
</div>
</div>
<img src="<?php bloginfo('template_url'); ?>/images/banner_1.jpg" alt="banner" />
</div>
<div class="swiper-slide">
<div class="banner_content">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-5">
<h2 class="title">WHITEBOARDS</h2>
<h1>Get Custom Whiteboards</h1>
<p>When it comes to shopping for your home, office or school.</p>
<a href="<?php echo get_bloginfo('url') ?>/product-category/" class="btn btn-primary">Shop Now</a>
</div>
</div>
</div>
</div>
<img src="<?php bloginfo('template_url'); ?>/images/banner_2.jpg" alt="banner" />
</div>
</div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</div>
<!-- banner section ends -->
<div class="container">
<div class="row">
<div class="col-sm-8 offset-sm-2 text-center">
<div class="product-classificaiton">
<a href="?type=design" class="<?php if($type=='design'){ echo 'active'; } ?>">Design Your Own</a>
<a href="?type=fast" class="<?php if($type=='fast'){ echo 'active'; } ?>">Fast Ship</a>
</div>
</div>
</div>
</div>
<section class="container burger">
<div class="container">
<div class="row">
<div class="col-12">
<?php
$data=array( 'taxonomy' => 'product_cat','parent'=>0);
$terms=array();
$catTerm = get_terms($data); // Get all terms of a taxonomy
// print_r($catTerm);
// die();
foreach($catTerm as $cat)
{
if($type=="design" && ($cat->name!="Whiteboards" && $cat->name!="Pinboards" && $cat->name!="Glassboards"))
{
}
else
{
$args = array(
'post_status' => 'publish',
'posts_per_page'=>4,
'tax_query' => array('relation' => 'AND',
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $cat->term_id
),
array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => array( $type1 ),
)
)
);
$prod = new WP_Query($args);
?>
<section>
<div class="heading d-flex justify-content-between mb-4">
<h3 class="text-secondary"><?php echo $cat->name ?></h3>
<a href="<?php echo get_bloginfo('url') ?>/products?cate_id=<?php echo $cat->term_id ?>&type=<?php echo $type ?>" class="btn btn-link">View All</a>
</div>
<div class="product-list">
<div class="row">
<?php
while ( $prod->have_posts() ) : $prod->the_post();
$_product = wc_get_product(get_the_ID());
?>
<div class="col-sm-3 mb-5">
<div class="pro-data">
<div class="pro_img bg-light-gray">
<div class="img">
<?php
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full');
if($featured_img_url==""){
?>
<img src="<?php echo bloginfo('template_url').'/images/no-image.png' ?>" alt="<?php echo get_the_title(); ?>" />
<?php
}
else
{
?>
<img src="<?php echo $featured_img_url; ?>" alt="<?php echo get_the_title(); ?>" />
<?php
}
?>
</div>
<div class="a animate">
<?php
$slug =get_post(get_the_ID());
if($type1=="Design Your Own"){?>
<a href="<?php echo get_site_url() ?>/custom-boards?slug=<?php echo $slug->post_name; ?>" class="btn btn-primary" title="<?php echo $slug->post_name; ?>">Customize</a>
<?php
}
else
{
?>
<a href="<?php echo get_site_url() ?>/product/<?php echo $slug->post_name; ?>" class="btn btn-primary" title="<?php echo $slug->post_name; ?>">View Details</a>
<?php
}
?>
</div>
</div>
<?php
global $post;
$product = new WC_Product(get_the_ID());
?>
<div>
<h4 class="animate"><?php echo get_the_title(); ?></h4>
<div class="pro_pirce">From <span><?php echo wc_price($product->get_price_including_tax(1,$product->get_price())); ?></span></div>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</section>
<?php
}
}
?>
</div>
</div>
</div>
</section>
<section class="video-seciton bg-gray burger">
<div class="container">
<div class="row align-items-center">
<div class="col-sm-7">
<div class="video">
<!-- <img src="<?php bloginfo('template_url'); ?>/images/video.jpg" alt="video" class="w-100" /> -->
<iframe src="https://www.youtube.com/embed/Wnbyh0ADMZw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="col-sm-5">
<div class="video-cnt">
<h4 class="text-secondary">Customize your board using our intuitive design tool</h4>
<p>Customily integrates into your eCommerce and gives your customers the possibility to personalize your products online</p>
<a href="custom-board.php" target="_blank" class="btn btn-primary mt-4">Take a Tour</a>
</div>
</div>
</div>
</div>
</section>
<?php get_footer();?>