| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/langngon.com/wp-content/themes/langngon/ |
Upload File : |
<?php
/**
*
* @copyright ZiniMedia 2016
* @version Release: 1.0
* @package langngon
* @author ZiniMedia-BM
*/
?>
<?php get_header(); ?>
<section class="main archive-main-wrapper">
<?php get_template_part("templates/entry/banner-taxonomy"); ?>
</section>
<section class="disable-block block-taxonomy-content">
<?php
$term_id = get_queried_object()->term_id;
$term_name = get_queried_object()->name;
$term_slug = get_queried_object()->slug;
$categories = get_terms( 'tvshow-category', array('orderby' => 'id','parent' => $term_id,) );
$args = array(
'posts_per_page' => POSTS_PER_PAGE_VIDEO,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'tvshow',
'post_status' => 'publish',
'suppress_filters' => true,
'tax_query' => array(
array(
'taxonomy' => 'tvshow-category',
'field' => 'slug',
'terms' => $term_slug,
)
)
);
$loop = get_posts( $args, ARRAY_A );
?>
<?php if (count($loop) > 0 && count($categories) < 2) {
?>
<!-- //.block-videos -->
<section class="block block-videos">
<div class="container">
<!-- //.Content-<?php echo $term_slug; ?>-videos -->
<div class="content">
<h3 class="title-bar"><a class="title-term" href="<?php echo get_term_link($term_id); ?>"><?php echo $term_name; ?></a></h3>
<?php //var_dump($categories); ?>
<div id="videos0-slide" class="section-content">
<?php get_object_videos($loop); ?>
</div>
</div>
</div>
</section>
<?php }else{ ?>
<?php
foreach ($categories as $key => $cate) {
$term_id = $cate->term_id;
$term_name = $cate->name;
$term_slug = $cate->slug;
$args = array(
'posts_per_page' => POSTS_PER_PAGE_VIDEO,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'tvshow',
'post_status' => 'publish',
'suppress_filters' => true,
'tax_query' => array(
array(
'taxonomy' => 'tvshow-category',
'field' => 'slug',
'terms' => $term_slug,
)
)
);
$loop = get_posts( $args, ARRAY_A );
?>
<?php if (count($loop) > 0) { ?>
<!-- //.block-videos -->
<section class="block block-videos">
<div class="container">
<!-- //.Content-<?php echo $term_slug; ?>-videos -->
<div class="content">
<h3 class="title-bar"><a class="title-term" href="<?php echo get_term_link($term_id); ?>"><?php echo $term_name; ?></a></h3>
<div id="videos<?php echo $key; ?>-slide" class="section-content">
<?php get_object_videos($loop); ?>
</div>
</div>
</div>
</section>
<?php } ?>
<?php } ?>
<?php } ?>
</section>
<?php get_footer(); ?>