<article class="article-four">
  <figure class="position-relative mb-0">
    <img src="<?php if(get_the_post_thumbnail_url()): ?>
<?php the_post_thumbnail_url('full'); ?>
<?php else: ?>
<?php echo wc_placeholder_img_src(); ?>
<?php endif; ?>" alt="article" class="d-block w-100" />
    <h2 class="position-relative text-nowrap overflow-hidden">
      <a href="<?php the_permalink(); ?>"> <?php
$title = get_the_title();
if ( wp_is_mobile() ) {
    echo wp_trim_words( $title, 5, '...' );
} else {
    echo wp_trim_words( $title, 8, '...' );
}
?> </a>
    </h2>
  </figure>
  <div class="date-view d-flex align-items-center justify-content-between">
    <span> <?php the_date(); ?> </span>
    <span>
    <?php
    $category = get_the_category(); 
    ?>
      <b> 
        <?php esc_html_e('Category:', 'kavehTheme'); ?> </b>
        <a href="<?php echo site_url('/category/') . $category[0]->slug; ?>">
      <?php
      echo $category[0]->cat_name;
      ?>
      </a>
    </span>
  </div>
</article>