HEX
Server: nginx/1.15.10
System: Linux vps240vn 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/vietktv.vn/wp-content/themes/binhvu/home.php
<?php get_header(); ?>
<div class="container-fluid">
	<div class="row">
		<div class="col-md-3 hidden-xs"></div>
		<div class="col-md-9 col-xs-12 break-col">
			<section id="slider">
				<div class="main-banner owl-carousel owl-theme">
					<?php if ( have_rows( 'list_slide', 'options' ) ) : ?>
						<?php while ( have_rows( 'list_slide', 'options' ) ) :
							the_row(); ?>
							<div class="item">
	                            <a href="<?php the_sub_field( 'link', 'options' ) ?>">
	                                <img src="<?php echo esc_url( get_sub_field( 'hinh_anh', 'options' ) ); ?>" alt="Ảnh 2">
	                            </a>
	                        </div>
						<?php endwhile; ?>
					<?php endif; ?>
				</div>
			</section>
		</div>
	</div>
</div>
<section id="best-sell-product">
	<div class="container-fluid">
		<div class="title-section">
			<h3>Sản phẩm bán chạy</h3>
			<span class="pull-right">
	            <ul class="nav panel-tabs">
					<?php 
			            $get_category  = get_field('chon_dm_spbanchay','option');   
			            foreach ($get_category as $list_cate) {
			                $term = get_term_by('id',$list_cate,'product_cat');
			                $slug = $term->slug;
			                $name = $term->name; ?>
			                <?php 
			                    $acts = array(
			                        'post_type'=>'product',
			                        'tax_query' => array(
			                            array(
			                                'taxonomy' => 'product_cat',
			                                'field'    => 'slug',
			                                'terms'    => $slug,
			                                'include_children' => true
			                            ),
			                        ),                          
			                    );
			                    $query_acts = new WP_Query( $acts );
			                ?>
				                <?php if($query_acts->have_posts()):?>
				                    <li>
				                        <a href="#<?php echo $term->term_id;?>" data-toggle="tab" aria-expanded="false"><?php echo $name;?></a>
				                    </li>
				                <?php endif;?>
			        	<?php   } ?>
	        	</ul>
	       	</span>
        </div>
        <div class="tab-content">
        	<?php 
                $get_category  = get_field('chon_dm_spbanchay','option');   
                foreach ($get_category as $list_cate) {
                    $term = get_term_by('id',$list_cate,'product_cat');
                    $slug = $term->slug;
                    $name = $term->name; ?>
                    <?php 
                        $acts = array(
                            'post_type'=>'product',
                            'tax_query' => array(
                                array(
                                    'taxonomy' => 'product_cat',
                                    'field'    => 'slug',
                                    'terms'    => $slug,
                                    'include_children' => true
                                ),
                            ),     
                            'showposts'=>10,                         
                        );
                        $query_acts = new WP_Query( $acts );
                    ?>
                    <?php if($query_acts->have_posts()):?>
                        <div class="tab-pane" id="<?php echo $term->term_id;?>">
                        	<div class="best_sell_carousel owl-carousel owl-theme">
                                <?php if($query_acts->have_posts()):?>
                                    <?php while ($query_acts->have_posts()) : $query_acts->the_post();?>
                                        <?php wc_get_template_part( 'content', 'product' ); ?>
                                    <?php endwhile; wp_reset_postdata();?>
                                <?php endif;?>
                            </div>
                        </div>
                    <?php endif;?>
            <?php   } ?>
        </div>
	</div>
</section>
<?php 
	$get_category  = get_field('chon_dmsp','option');   
	foreach ($get_category as $list_cate) {
	    $term = get_term_by('id',$list_cate,'product_cat');
	    $slug = $term->slug;
	    $name = $term->name; ?>
	    <?php 
	        $acts = array(
	            'post_type'=>'product',
	            'tax_query' => array(
	                array(
	                    'taxonomy' => 'product_cat',
	                    'field'    => 'slug',
	                    'terms'    => $slug,
	                    'include_children' => true
	                ),
	            ),     
	            'showposts'=>10,                         
	        );
	        $query_acts = new WP_Query( $acts );
	    ?>
	    <?php if($query_acts->have_posts()):?>
	        <section id="product-list-cat">
	        	<div class="container-fluid">
	        		<div class="list-cat">
	        			<div class="title-section">
			              	<h3><a href="<?php echo get_term_link($term->term_id);?>"><?php echo $name;?></a></h3>
			            </div>
			            <div class="product-list owl-carousel owl-theme">
			                <?php if($query_acts->have_posts()):?>
			                    <?php while ($query_acts->have_posts()) : $query_acts->the_post();?>
			                        <?php wc_get_template_part( 'content', 'product' ); ?>
			                    <?php endwhile; wp_reset_postdata();?>
			                <?php endif;?>
			            </div>
			        </div>
	            </div>
	        </section>
	    <?php endif;?>
	<?php   } ?>
<?php get_footer(); ?>