<?php get_header(); ?> 
<div class="container my-1 bg-light text-dark">
  <div class="row">
     <div class="col-md-4 entry-content">
       <?php get_sidebar(); ?>
     </div>
    <div class="col-md-8">
      <?php if (have_posts()) : ?>
        <h2 style="border-left:3px solid black; padding-left:5px;" id="head-line" class="container">
            <?php the_archive_title(); ?>
          </h2>
           <?php while (have_posts()) : the_post(); ?>
               <article class="" id="post-<?php the_ID(); ?>" <?php post_class('mb-4'); ?> itemscope itemtype="https://schema.org/BlogPosting">
              <div class="">
                <div class="post-thumbnail-wrapper position-relative">
     <?php if (has_post_thumbnail()) : ?>
        <?php the_post_thumbnail('large', ['class' => 'img-fluid']); ?>
    <?php endif; ?>
                  </div>
              </div>
     <header class="container entry-content">
       <h2 class="h4"><a href="<?php echo esc_url(get_permalink() ); ?>" rel="bookmark" itemprop="url"><span itemprop="headline"><?php the_title(); ?></span></a></h2>
           <div class="row container">
               <p class="text-muted"><time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished"><?php echo get_the_date(); ?></time></p> ,
                <p class="text-muted pl-2">
          <?php
            if ( get_theme_mod( 'howcan_enable_post_views', true ) ) {
              echo '<div class="post-views">' . esc_html( howcan_get_post_views( get_the_ID() ) ,'howcan' ).'</div>';
            }
            ?>
                </p>
           </div>
      </header>
                     
      <div class="container" itemprop="articleBody">
          <p class="card-text">
          <?php
          echo esc_html( wp_trim_words( get_the_content(), 30, '...' ),'howcan');
          ?>
         </p>
          <a class="btn btn-dark" href="<?php
              echo esc_url(                 get_permalink() ); ?>"><?php echo esc_html__(get_theme_mod('howcan_pdb_text', 'howcan'));
            ?>
            </a>
        </div>
        <hr>
     </article>
      <?php endwhile; ?>
               
  <div class="pagination">
    <?php
        the_posts_pagination(array(
          'mid_size' => 2,
          'prev_text' => '<span class="arrow-left">«</span>',
          'next_text' => '<span class="arrow-right">»</span>',
          'screen_reader_text' => ' ',
        ));
      ?>
  </div>
     <?php else : ?>
         <p>
          <?php echo esc_html( 'No posts found.', 'howcan' ); ?>
          </p>
       <?php endif; ?>
     </div>
   </div>
 
<?php get_footer(); ?> 