File: /www/wwwroot/vietktv.vn/wp-content/themes/binhvu/single.php
<?php get_header(); ?>
<?php if (have_posts()): the_post() ; ?>
<div class="breadcrumb-head">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php if ( function_exists('yoast_breadcrumb') ) {yoast_breadcrumb( '<div class="breadcrumb">','</div>' );}?>
</div>
</div>
</div>
</div>
<section id="wrap-news-cat" class="is-moved-by-drawer">
<div class="container-fluid">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-12 main-content">
<div class="popular-cat-title">
<h1><?php the_title();?></h1>
</div>
<div class="list-item-news-cat">
<div class="content-new">
<?php the_content();?>
</div>
<?php
$categories = get_the_category($post->ID);
if ($categories) :
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'showposts'=>5,
'ignore_sticky_posts' => 1
);
$related = new wp_query($args);
if( $related->have_posts() ) :?>
<div class="related-articles">
<div class="related-articles-head">
<h3>
Bài viết liên quan
</h3>
</div>
<div class="related-articles-body">
<ul class="no-bullets">
<?php while ($related->have_posts()) : $related->the_post(); ?>
<li><a class="a" href="<?php the_permalink();?>">- <?php the_title();?></a></li>
<?php endwhile;?>
</ul>
</div>
</div>
<?php endif ;?>
<?php endif ;?>
</div>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<?php get_sidebar();?>
</div>
</div>
</div>
</section>
<?php endif;?>
<?php get_footer(); ?>