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

?>
<div class="col-lg-6">
	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<?php ndesign_post_thumbnail(); ?>
		<header class="entry-header">
			<?php
			if ( is_singular() ) :
				the_title( '<h1 class="entry-title main-title my-3">', '</h1>' );
			else :
				the_title( '<h2 class="entry-title main-title my-3"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
			endif;
			if ( 'post' === get_post_type() ) :
				?>
				<div class="entry-meta blog-date mb-3">
					<?php
					ndesign_posted_on();
					ndesign_posted_by();
					echo '<br/>';
					?>
				</div><!-- .entry-meta -->
			<?php endif; ?>
		</header><!-- .entry-header -->
		<div class="entry-content">
			<?php echo wp_trim_words( get_the_excerpt(), 25, '...' ); ?>
			<?php
			wp_link_pages(
				array(
					'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'ndesign' ),
					'after'  => '</div>',
				)
			);
			?>
		</div><!-- .entry-content -->
		<footer class="entry-footer">
			<?php ndesign_entry_footer(); ?>
		</footer><!-- .entry-footer -->
	</article><!-- #post-<?php the_ID(); ?> -->
</div>
