<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package BBase_Code
 */

get_header();
?>
	<?php
	if ( function_exists('yoast_breadcrumb') ) {
		yoast_breadcrumb( '<div class="container" id="breadcrumbs">','</div>' );
	}
	?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main">
			<div class="container">
				<?php
				while ( have_posts() ) : the_post();
					the_title( '<h1 class="post-title">', '</h1>' );

					the_content();

				endwhile; // End of the loop.
				?>

				<div class="wrap-share">
					<span><?php _e( 'Chia sẻ:', 'tbang_text' ); ?></span>
					<ul>
						<li><a href="#"><img src="<?php echo tbang_img_link( 'facebook.svg' ) ?>" alt="Facebook"></a></li>
						<li><a href="#"><img src="<?php echo tbang_img_link( 'twitter.svg' ) ?>" alt="Twitter"></a></li>
					</ul>
				</div>

				<div class="related-post">
					<h2 class="title"><?php _e( 'TIN TỨC KHÁC', 'tbang_text' ) ?></h2>
					<div class="list-news">
					<?php 
						$args = array(
							'posts_per_page'         => '3',
						);

						$query = new WP_Query( $args );
						if ( $query->have_posts() ) {
							while ( $query->have_posts() ) { $query->the_post();
								get_template_part( 'template-parts/content', get_post_type() );
							}
						}

						wp_reset_postdata();
					?>		
					</div>			
				</div>
			</div>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php
get_footer();
