File: /home/dalieudr/public_html/wp-content/themes/MD-THEME/index.php
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package SH_Theme
*/
global $sh_option;
get_header(); ?>
<div id="primary" class="content-sidebar-wrap">
<?php do_action( 'before_main_content' ) ?>
<main id="main" class="site-main" role="main">
<?php do_action( 'before_loop_main_content' ) ?>
<!-- --------------------- Products --------------------- -->
<?php
//if ( class_exists( 'WooCommerce' ) ) {
// if( $sh_option['list_cat_product'] ) {
// $list_cat_product = $sh_option['list_cat_product'];
// if( $sh_option['number_product'] ) {
// $number_product = $sh_option['number_product'];
// }
// if( $sh_option['number_product_row'] ) {
// $number_product_row = $sh_option['number_product_row'];
// }
// echo '<div class="product-wrap">';
// foreach ($list_cat_product as $key => $idpost) {
// echo '<h2 class="heading"><a title="'. get_dm_name( $idpost,'product_cat' ) .'" href="'. get_dm_link( $idpost,'product_cat' ) .'">'. get_dm_name( $idpost,'product_cat' ) .'</a></h2>';
// echo do_shortcode('[shproduct posts_per_page="' . $number_product . '" categories="' . $idpost . '" numcol="' . $number_product_row . '"]');
// }
// echo '</div>';
// }
//}
?>
<!-- --------------------- News --------------------- -->
<?php
//if( $sh_option['list_cat_post'] ) {
// $list_cat_post = $sh_option['list_cat_post'];
// if( $sh_option['number_news'] ) {
// $number_news = $sh_option['number_news'];
// }
// if( $sh_option['type_layout'] ) {
// $type_layout = $sh_option['type_layout'];
// }
// echo '<div class="news-wrap">';
// foreach ($list_cat_post as $key => $idpost) {
// echo '<h2 class="heading"><a title="'. get_cat_name( $idpost ) .'" href="'. get_category_link( $idpost ) .'">'. get_cat_name( $idpost ) .'</a></h2>';
// echo do_shortcode('[shblog posts_per_page="' . $number_news . '" categories="' . $idpost . '" number_character="140" style="' . $type_layout . '"]');
// }
// echo '</div>';
//}
?>
<section class="home-bacsi">
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 bacsi-left flex-box-item-center-right">
<div class="wrap-bacsi">
<img src="<?php echo $sh_option['team-img']['url'] ?>" alt="<?php echo $sh_option['team-title'] ?>" />
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 bacsi-right">
<div class="wrap-bacsi-right">
<h2 class="fontsize-30 font-weight-400 text-center mb-5"><?php echo $sh_option['team-title'] ?></h2>
<div class="slider-for">
<?php $team_slide = $sh_option['team-slide'];
foreach ($team_slide as $key => $value) { ?>
<div class="item-content-bacsi">
<div class="title">
<h3 class="fontsize-18 text-uppercase font-weight-500 mb-4"><?php echo $value['title'] ?></h3>
</div>
<div class="description">
<?php echo wpautop($value['description']); ?>
</div>
</div>
<?php } ?>
</div>
<div class="slider-nav slick-slider-images">
<?php foreach ($team_slide as $key => $value) { ?>
<div class="item-bacsi">
<div class="mb-4">
<img src="<?php echo $value['image'] ?>" alt="Bác sĩ 1">
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="home-coso">
<div class="container">
<h2 class="fontsize-30 font-weight-400 text-center mb-5">Cơ sở vật chất</h2>
<?php $rows = get_field('list','option');if($rows){ ?>
<ul class="nav nav-pills mb-5 flex-box-center" id="pills-tab" role="tablist">
<?php $cou = 0; foreach($rows as $row){ $cou++;?>
<li class="nav-item">
<a class="nav-link" id="pills-<?php echo $cou; ?>-tab" data-toggle="pill" href="#pills-<?php echo $cou; ?>" role="tab" aria-controls="pills-<?php echo $cou; ?>" aria-selected="true"><?php echo $row['title'] ?></a>
</li>
<?php } ?>
</ul>
<div class="tab-content" id="pills-tabContent">
<?php $cou = 0; foreach($rows as $rowe){ $cou++; ?>
<div class="tab-pane fade <?php if($cou == 1): echo 'show active'; endif; ?>" id="pills-<?php echo $cou; ?>" role="tabpanel" aria-labelledby="pills-<?php echo $cou; ?>-tab">
<div class="row list-image">
<?php $rows = $rowe['list_item'];if($rows){
$count = 0;
foreach($rows as $rowss){ $count++; if ($count < 3):?>
<div class="col-6 col-lg-4">
<div class="list2">
<img src="<?php echo $rowss['img'] ?>" />
</div>
</div>
<?php endif; } ?>
<div class="col-12 col-lg-4">
<?php $count = 0;
foreach($rows as $rowss){ $count++; if ($count > 2):?>
<div class="list3" style="padding-bottom: 15px;">
<img src="<?php echo $rowss['img'] ?>" />
</div>
<?php endif; }} ?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</section>
<section class="home-khachhang">
<div class="container">
<h2 class="fontsize-30 font-weight-400 text-center mb-5">Cảm nhận khách hàng</h2>
<div class="slider-nav slick-slider-images">
<?php $testi_slide = $sh_option['testi-slide'];
foreach ($testi_slide as $key => $value) { ?>
<div class="item-khachhang">
<div class="mb-4">
<img src="<?php echo $value['image'] ?>" alt="<?php echo $value['title'] ?>">
</div>
</div>
<?php } ?>
</div>
<div class="slider-for"> <?php
foreach ($testi_slide as $key => $value) { ?>
<div class="item-content">
<div class="title">
<h3 class="fontsize-18 text-uppercase font-weight-500"><?php echo $value['title'] ?></h3>
<p class="font-weight-300"><?php echo $value['url'] ?></p>
</div>
<div class="description">
<p class="mb-0"><?php echo $value['description'] ?></p>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<section class="home-phuongphap">
<div class="container">
<h2 class="fontsize-30 font-weight-400 text-center mb-5">Dịch vụ</h2>
<div class="slick-carousel list-phuongphap row"
data-item="4"
data-item_md="4"
data-item_sm="2"
data-item_mb="1"
data-row="1"
data-dots="false"
data-arrows="true"
data-vertical="false">
<?php $solution_slide = $sh_option['solution-slide'];
foreach ($solution_slide as $key => $value) { ?>
<div class="col-6 col-sm-6 col-md-3 col-lg-3 col-xl-3">
<div class="item-phuongphap">
<img class="mb-4" src="<?php echo $value['image'] ?>" alt="<?php echo $value['title'] ?>" />
<div class="descrip-customer text-center">
<h3 class="fontsize-18 text-uppercase font-weight-600 mb-4"><?php echo $value['title'] ?></h3>
<p><?php echo $value['description'] ?></p>
<a class="a-more" href="<?php echo $value['url'] ?>">Xem thêm</a>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<section class="home-tuvan">
<div class="container">
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 text-center">
<img src="<?php echo $sh_option['cta-img']['url'] ?>" alt="Tư vấn online" />
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
<p class="fontsize-16 text-uppercase mb-5"><?php echo $sh_option['cta-title'] ?></p>
<h3 class="fontsize-35 text-uppercase mb-1"><?php echo $sh_option['cta-title-2'] ?></h3>
<h2 class="fontsize-45 color-faaf3e text-uppercase mb-5"><?php echo $sh_option['cta-title-3'] ?></h2>
<p class="content-tuvan font-weight-500 mb-5"><?php echo $sh_option['cta-txt'] ?></p>
<a class="a-more" href="<?php echo $sh_option['cta-link'] ?>">Đăng ký tư vấn ngay</a>
</div>
</div>
</div>
</section>
<section class="home-coso">
<div class="container">
<h2 class="fontsize-30 font-weight-400 text-center mb-5">Trải nghiệm thật từ khách hàng</h2>
<?php $rows = get_field('list2','option');if($rows){ ?>
<ul class="nav nav-pills mb-5 flex-box-center" id="pills-tabs" role="tablist">
<?php $cou = 0; foreach($rows as $row){ $cou++;?>
<li class="nav-item">
<a class="nav-link" id="pills-t<?php echo $cou; ?>-tab" data-toggle="pill" href="#pills-t<?php echo $cou; ?>" role="tab" aria-controls="pills-t<?php echo $cou; ?>" aria-selected="true"><?php echo $row['title'] ?></a>
</li>
<?php } ?>
</ul>
<div class="tab-content" id="pills-tabContent">
<?php $cou = 0; foreach($rows as $rowe){ $cou++; ?>
<div class="tab-pane fade <?php if($cou == 1): echo 'show active'; endif; ?>" id="pills-t<?php echo $cou; ?>" role="tabpanel" aria-labelledby="pills-t<?php echo $cou; ?>-tab">
<div class="row list-image">
<?php $rows = $rowe['list_item'];if($rows){
$count = 0;
foreach($rows as $rowss){ $count++; if ($count < 2):?>
<div class="col-12 col-lg-6">
<div class="list2">
<img src="<?php echo $rowss['img'] ?>" />
</div>
</div>
<?php endif; } ?>
<div class="col-12 col-lg-6">
<div class="row">
<?php $count = 0;
foreach($rows as $rowss){ $count++; if ($count > 1):?>
<div class="col-12 col-lg-6">
<img src="<?php echo $rowss['img'] ?>" />
</div>
<?php endif; }} ?>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</section>
<section class="home-tuvan" id="home-tuvan">
<div class="container">
<div class="row">
<div class="col-12 col-sm-12 col-md-5 col-lg-5 col-xl-5">
<p class="fontsize-16 text-uppercase mb-5">Đăng ký tư vấn nhận ưu đãi</p>
<?php echo do_shortcode('[contact-form-7 id="86" title="Lịch tư vấn"]') ?>
</div>
<div class="col-12 col-sm-12 col-md-7 col-lg-7 col-xl-7 text-center">
<img src="<?php echo $sh_option['cta2-img']['url'] ?>" alt="Tư vấn online" />
</div>
</div>
</div>
</section>
</main>
</div>
<?php
get_footer();