<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Buconz Starter
 */
 
?>
	<!-- Single News -->
	<div class="blog-single-main">
		<div class="main-image">
			<?php if(has_post_thumbnail() ): ?>
				<?php the_post_thumbnail('buconz-starter-blog-single-thumb'); ?>
			<?php endif;?>
		</div>
		<div class="blog-detail">
			<!-- News Meta -->
			<ul class="news-meta">
				<li><i class="fa fa-user"></i><a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"><?php 
					buconz_starter_posted_by(); ?></a></li>
				<li><i class="fa fa-pencil"></i><?php buconz_starter_posted_on(); ?></li>
				<li><i class="fa fa-comments"></i><?php echo esc_html(get_comments_number());?> <?php esc_html_e('comments', 'buconz-starter'); ?></li>
			</ul>
			<h2 class="blog-title"><?php the_title(); ?></h2>
			<?php the_content(); ?>
		</div>
			
		<?php wp_link_pages( array(
			'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'buconz-starter' ),
			'after'  => '</div>',
		) );
		?>
		<div class="blog-post-tag">
			<div class="row">
				<div class="col-lg-7 col-md-6 col-12">
					<div class="share-tag post-tag">
						<h3><?php echo esc_html_e('Related Tags', 'buconz-starter');?></h3>
						<?php 
						$post_tags = get_the_tags();
						if ( ! empty( $post_tags ) ) {
							echo '<ul>';
							foreach( $post_tags as $post_tag ) {
								echo '<li><a href="' . get_tag_link( $post_tag ) . '">' . $post_tag->name . '</a></li>';
							}
							echo '</ul>';
						}   
						?>

					</div>
				</div>
				<div class="col-lg-5 col-md-6 col-12">
					<div class="share-tag blog-share">
						<h3><?php echo esc_html_e('Choose post', 'buconz-starter');?></h3>
						<div class="posts_nav">
							<div class="post-left">
								<a href="<?php echo esc_url(get_permalink(get_adjacent_post(false,'',false))); ?>"><i class="fa fa-angle-left"></i><?php esc_html_e("Previous post","buconz-starter"); ?></a>
							</div>
							<div class="post-right">			
								<a href="<?php echo esc_url(get_permalink(get_adjacent_post(false,'',true))); ?>"><?php esc_html_e("Next post","buconz-starter"); ?><i class="fa fa-angle-right"></i></a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>