index.php 5.9 KB
<?php $get_lang = isset($wp_query->query_vars['prisna_translate_seo_request'])?urldecode($wp_query->query_vars['prisna_translate_seo_request']):''; ?>

<?php get_header();?>

<section class="web_main index_main">

  <!-- banner -->
<section class="slider_banner">
      <div class="swiper-wrapper">
      <?php $images = get_get_field('ad_index_banner'); if( $images ): foreach( $images as $image ): ?>
        <div class="swiper-slide" data-slidertxt="<?php echo $image['title']; ?>"><a href="<?php echo $image['alt']; ?>"> <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['title']; ?>"/></a></div>
      <?php endforeach; endif; ?>
      </div>
      <div class="swiper-button-prev swiper-button-white"><span class="slide-page-box"></span></div>
      <div class="swiper-button-next swiper-button-white"><span class="slide-page-box"></span></div>
      <ul class="slider_pages"></ul>
    </section>
  <section class="index_promote">
      <div class="layout">
        <header class="index_hd">
          <h2 class="hd_title">Featured Products</h2>
          <p class="hd_desc">With constantly optimizing and innovating in KT-LoRa, KingTing has launched a series of YoSmart smart home devices.</p>
        </header>
        <div class="index_bd">
          <ul class="promote_list">
          <?php $args = array('showposts' => 12, 'post_type' => 'post', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'special','value' => 'Feature Products','compare' => 'LIKE')));

$the_query = new WP_Query( $args );$i=1; if( $the_query->have_posts() ): while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
              <li class="promote_cell">
                <div class="cell_img wow fadeInUpA"><a class="scale_img" href="<?php the_permalink() ?>"><img src="<?php $images = get_field('product_gallery'); if( $images ): for($x=0;$x<1; $x++){ ?><?php echo $images[0]['sizes']['thumbnail']; ?><?php } endif; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>"/></a></div>
                <div class="cell_cont wow fadeInUpA">
                  <h3 class="cell_tit"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></h3>
                  <h4 class="cell_subtit">Short Description:</h4>
                  <div class="cell_desc"><?php echo mb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)), 0, 50,"..."); ?></div>
                  <div class="learn_more">
                    <a href="<?php the_permalink() ?>" class="sys_btn btn_more">MORE&gt;&gt;</a>
                  </div>
                </div>
              </li>
             <?php  $i++; endwhile; endif;  wp_reset_query(); ?>  
          </ul>
        </div>
      </div>
    </section>
   

    <section class="index_product">
      <div class="layout">
        <div class="index_bd">
          <ul class="product_items">
          <?php $args = array('showposts' => 9, 'post_type' => 'post', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'special','value' => 'New Arrivals','compare' => 'LIKE')));

$the_query = new WP_Query( $args );$i=1; if( $the_query->have_posts() ): while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
            <li class="product_item wow fadeInLeftA" data-wow-delay=".1s">
              <figure> 
               <span class="item_img"><img src="<?php $images = get_field('product_gallery'); if( $images ): for($x=0;$x<1; $x++){ ?><?php echo $images[0]['sizes']['thumbnail']; ?><?php } endif; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>"/><a href="<?php the_permalink() ?>"></a></span>
                  <figcaption>
                    <h3 class="item_title"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></a></h3>
                  <div class="item_desc"><?php echo mb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)), 0, 50,"..."); ?>.</div>
                  <div class="learn_more">
                    <a href="" class="sys_btn">More</a>
                  </div>
                </figcaption>
              </figure>
            </li>
         <?php $i++; endwhile; endif;  wp_reset_query(); ?>
          </ul>
        </div>
      </div>
    </section>
<section class="index_news">
      <div class="layout">
        <header class="index_hd">
          <h2 class="hd_title">News</h2>
        </header>
        <?php query_posts(array( 'post_type' => 'news','showposts' => 5,'orderby' => 'post_date','order'=> 'DESC') ); while (have_posts()) : the_post();?>
        <div class="index_bd wow fadeInUpA">
          <div class="news_item">
            <figure>
              <div class="item_img"><a class="scale_img" href="<?php echo $get_lang?home_url('/')  .$get_lang.'/news/' . $post->post_name:home_url('/') .'news/' . $post->post_name ; ?>"><?php $image = get_field('news_img');if( !empty($image) ): ?><img src="<?php echo $image['url']; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>"></a><?php endif; ?></div>
              <figcaption class="item_cont">
                <time class="item_time"><?php the_time('d/M') ?></time>
                <h3 class="item_tit"><a href="<?php echo $get_lang?home_url('/')  .$get_lang.'/news/' . $post->post_name:home_url('/') .'news/' . $post->post_name ; ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 44,"..."); ?></a></h3>
                <div class="item_desc"><?php echo mb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)), 0, 44,"..."); ?> </div>
                <a class="item_more" href="">More<i>&gt;&gt;</i></a>
              </figcaption>
            </figure>
          </div>
        </div>
        <?php endwhile; wp_reset_query();  ?> 
      </div>
    </section>
</section>
<?php get_footer();?>