123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <?php
- /**
- * Template Name: Home Page
- */
- $post_id = get_the_ID();
- $page_data = get_post_meta( $post_id, 'ptc_care', true );
- $stores = $page_data['stores'];
- $store_count = $page_data['store_count'];
- ?>
- <?php get_template_part( 'part', 'header' ) ?>
- <body>
- <?php get_template_part( 'part', 'nav' ) ?>
- <div id="banner-swiper" class="swiper">
- <div class="swiper-wrapper">
- <?php
-
- ?>
- <?php
- if(is_array( $page_data['sliders'] ) && !empty( $page_data['sliders'] )){
- foreach( $page_data['sliders'] as $item ){
- ?>
- <div class="swiper-slide banner" style="--bg-sm: url('<?php echo $item; ?>'); --bg-md: url('<?php echo $item; ?>')"></div>
- <?php }
- } ?>
- </div>
- <div class="swiper-pagination"></div>
- </div>
- <div class="services-wrap">
- <div class="services">
- <?php
- $items = ptc_get_product_list();
-
- if(is_array( $items ) && !empty( $items )){
- foreach( $items as $item ){
- ?>
- <div class="service">
- <p class="service-name"><i class="service-icon" style="background-image: url(<?php echo $item['image']; ?>);"></i><?php echo $item['name'] ?></p>
- <p class="service-desc">
- <?php echo $item['remark'] ?>
- </p>
- <ul class="service-details">
- <?php
- foreach ($item['rights'] as $right ):
- ?>
- <li class="item">
- <span class="item-name"><?php echo $right['title'] ?></span>
- <span class="item-value"><?php echo $right['value'] ?></span>
- </li>
- <?php endforeach; ?>
- </ul>
- <div class="service-cost">
- <div class="price">
- <span class="p1">$</span><span class="p2"><?php echo $item['amount_month'] ?></span
- ><span class="p3">Monthly</span>
- </div>
- <button class="buy" data-action="buy" data-id="<?php echo $item['id'] ?>">Buy Now</button>
- </div>
- </div>
- <?php
- }
- }
- ?>
- </div>
- </div>
- <div class="details">
- <div class="details-inner">
- <?php
- if(is_array( $page_data['items'] ) && !empty( $page_data['items'] )){
- foreach( $page_data['items'] as $item ){
- ?>
- <div class="detail">
- <h3 class="d-title"><?php echo $item['title'] ?></h3>
- <p class="d-content">
- <?php echo $item['desc'] ?>
- </p>
- <img class="d-img" src="<?php echo $item['thumb'] ?>" />
- </div>
- <?php }} ?>
-
-
- </div>
- </div>
- <div class="others">
- <div class="block">
- <h3 class="block-title tac underline">Common Problem</h3>
- <ul class="problems">
- <?php
- $args = array(
- 'post_type' => array('faq'),
- 'posts_per_page' => -1,
- );
- $cache_key = md5( serialize( $args ) );
- $cache_group = wp_cache_get_last_changed( 'posts' );
- $query = wp_cache_get( $cache_key, $cache_group);
- if($query === false){
- $query = new WP_Query($args);
- wp_cache_set( $cache_key, $query, $cache_group, 600 );
- }
- $items = [];
- if($query->have_posts()):
- $i = 0;
- while ($query->have_posts()): $query->the_post();
- global $post;
- ?>
- <li class="problem <?php echo $i == 0 ? 'focus': ''; ?>">
- <p class="question"><?php the_title( ) ?></p>
- <p class="answer">
- <?php echo $post->post_excerpt; ?>
- </p>
- </li>
- <?php
- $i++;
- endwhile;
- else:
-
- endif; ?>
-
- </ul>
- </div>
- <div class="block">
- <h3 class="block-title tac">Contact Us</h3>
- <p class="sub-title tac">
- Providing the best solutions for smart devices in Australia
- </p>
- <div class="flex-up-lg">
- <div class="apps">
- <a class="app" href="https://www.facebook.com/PTCAustralia" target="_blank"></a>
- <a class="app" href="https://www.linkedin.com/company/ptc-phone-tech-and-comm" target="_blank"></a>
- <a class="app" href="https://www.instagram.com/ptcshop_/" target="_blank"></a>
- </div>
- <div class="phone">
- <i class="phone-icon"></i>
- <div class="phone-number">
- <p>1300 000 349</p>
- <p>Mon - Fri : 9:00 - 16:00</p>
- </div>
- </div>
- <!-- <button id="btn-book" class="block-btn">BOOK A REPAIR</button> -->
- <a class="block-btn" href="https://www.ptc.net.au/booking/" role="button">BOOK A REPAIR</a>
- </div>
- </div>
- <div class="block">
- <h3 class="block-title">Now over <?php echo $store_count; ?> stores across Australia</h3>
- <div class="flex-up-lg">
- <div class="store-list-wrap">
- <?php
- $len = ceil( count( $stores ) / 2 );
- $stores = array_chunk( $stores , $len);
- ?>
- <ul class="store-list">
- <?php
- foreach( $stores[0] as $item ){
-
- ?>
- <li class="store">
- <a href="<?php echo esc_url( $item['url'] ) ?>">
- <?php echo $item['name'] ?>
- </a>
- </li>
- <?php
- }
- ?>
- </ul>
- <ul class="store-list">
- <?php
- if(is_array( $stores[1] ) && !empty( $stores[1] )){
- foreach( $stores[1] as $item ){
- ?>
- <li class="store">
- <a href="<?php echo esc_url( $item['url'] ) ?>">
- <?php echo $item['name'] ?>
- </a>
- </li>
- <?php
- }
- } ?>
- </ul>
- </div>
- <a class="block-btn" href="https://www.ptc.net.au/store-locator/" role="button">Find the nearest store</a>
- </div>
- </div>
- </div>
- <?php get_template_part( 'part', 'footer' ) ?>
- </body>
- </html>
|