<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package dulcie
 */

?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
	<div class="post-heading-wrap">
		<?php
		if ( is_singular() ) :
			the_title( '<h1 class="title">', '</h1>' );
		else :
			the_title( '<h2 class="title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		endif;

		if ( 'post' === get_post_type() ) : ?>
			<!-- Post Details -->
			<ul class="post-details">
				<li><i class="fa fa-calendar"></i><?php dulcie_posted_on(); ?></li>
				<li><i class="fa fa-tags"></i><?php dulcie_entry_meta(); ?></li>
				<li><a href="<?php echo esc_url( get_comments_link() ); ?>"><i class="fa fa-comment" aria-hidden="true"></i><?php comments_number(); ?></a></li>
			</ul>
			<!-- End Post Details -->
		<?php endif; ?>
	</div>
	<div class="post-media">
		<?php dulcie_post_thumbnail(); ?> 
	</div>
	<div class="post-content">
		<div class="the-content">
			<?php
			the_content(
				sprintf(
					wp_kses(
						/* translators: %s: Name of current post. Only visible to screen readers */
						__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'dulcie' ),
						array(
							'span' => array(
								'class' => array(),
							),
						)
					),
					wp_kses_post( get_the_title() )
				)
			);

			wp_link_pages(
				array(
					'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'dulcie' ),
					'after'  => '</div>',
				)
			);
			?>
		</div>
		<div class="post-footer">
			<div class="post-share-wrap">
				<?php do_action('dulcie_social_sharing'); ?>
			</div>

			<div class="post-details single-tags">
				<?php dulcie_entry_tags(); ?>
			</div>
		</div>
		<?php
			the_post_navigation(
				array(
					'prev_text' => '<span class="nav-title">%title</span>',
					'next_text' => '<span class="nav-title">%title</span>',
				)
			);

			// If comments are open or we have at least one comment, load up the comment template.
			if ( comments_open() || get_comments_number() ) :
				comments_template();
			endif;
		?>
	</div>
</article><!-- #post-<?php the_ID(); ?> -->
