<article class="blog-cart">
    <div class="blog-top">

        <div class="blog-img-wraper">
            <?php
            hinza_show_img()
            ?>
        </div>
        <div class="blog-info">
            <div class="blog-category">
                <?php
                // Get all categories assigned to the post
                $categories = get_the_category();

                // Check if there are any categories
                if ($categories) {
                    // Get the first category (main category)
                    $main_category = $categories[0];

                    // Display the main category
                    echo '<a href="' . esc_url(get_category_link($main_category->term_id)) . '">' . esc_html($main_category->name) . '</a>';
                }
                ?>
            </div>
            /
            <div class="blog-date">
                <?php echo get_the_date() ?>
            </div>
        </div>
    </div>
    <h2 class="blog-title">
        <a href="<?php echo get_the_permalink() ?>"><?php echo get_the_title() ?></a>
    </h2>
    <div class="blog-expert">
        <?php
        echo excerpt_content(20);
        ?>
    </div>
    <?php echo '<a class="blog-read-more" href="'.get_the_permalink().'">ادامه مطلب<i aria-hidden="true" class="fas fa-arrow-left"></i></a>'; ?>
    <div class="blog-info-bottom">
        <div class="blog-date">
            <?php echo get_the_date() ?>
        </div>
    </div>
</article>