File: /www/wwwroot/vietktv.vn/wp-content/themes/binhvu.off/single.php
<?php get_header(); ?>
<div id="single-tmp" class="site-main-wrapper page-wrapper has-left-sidebar">
<div class="container">
<div class="row row-collapse">
<div class="col hidden-xs col-sm-4 col-md-3 main-sidebar">
<?php get_sidebar();?>
</div>
<div class="col-xs-12 col-sm-8 col-md-9 main content">
<main class="site-main">
<section class="singular-content">
<?php if (have_posts()): the_post() ; ?>
<h6 class="entry-category is-xsmall">
<?php
global $post;
$postcat = get_the_category( $post->ID );
if ( ! empty( $postcat ) ) {
echo esc_html( $postcat[0]->name );
}
?>
</h6>
<header class="section-header tmp-title-bar tmp-title-bar-sg clearfix">
<h1 class="title"><?php the_title();?></h1>
</header>
<div class="entry-divider is-divider small"></div>
<div class="section-main clearfix">
<?php the_content();?>
</div>
<?php endif;?>
</section>
<nav class="nav-single">
<span class="nav-previous">
<?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '← TRƯỚC', 'Previous post link', '' ) . '</span> %title' ); ?>
</span>
<span class="nav-next">
<?php next_post_link( '%link', '<span class="meta-nav">' . _x( 'SAU →', 'Next post link', '' ) . '</span> %title' ); ?>
</span>
</nav><!-- .nav-single -->
<?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'=>12,
'ignore_sticky_posts' => 1
);
$related = new wp_query($args);
if( $related->have_posts() ) :?>
<section class="single-related-posts">
<header class="section-header related-title-bar clearfix">
<span class="title">Bài viết khác</span>
</header>
<div class="section-main">
<ul> <?php while ($related->have_posts()) : $related->the_post(); ?>
<li><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
<?php endwhile;?></ul>
</div>
</section>
<?php endif ;?>
<?php endif ;?>
</main>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>