<?php $kproduct = get_query_var('kproduct'); ?>
<div class="article-three">
  <figure>
    <a href="<?php echo $kproduct['link'] ?>">
      <img src="<?php echo $kproduct['kaveh_custom']['thumbnail_url'] ?>" alt="<?php echo $kproduct['title']['rendered']; ?>" />
    </a>
    <?php
    $category = get_the_category($kproduct['id']); 
    ?>
    <a href="<?php echo site_url('/category/') . $category[0]->slug; ?>" class="category"> <?php
      echo $category[0]->cat_name;
      ?> </a>
  </figure>
  <h2>
    <a href="<?php echo $kproduct['link'] ?>"> <?php echo $kproduct['title']['rendered']; ?> </a>
  </h2>
  <div class="d-flex">
    <p> <?php echo $kproduct['kaveh_custom']['excerpt']; ?> </p>
  </div>
</div>
