File: /mnt/data/dreamsrent-wp-demo/wp-content/themes/dreamsrent/templates/blog/blog-post.php
<?php $post_id = get_the_ID(); ?>
<?php $sticky_class = is_sticky()?'sticky':''; ?>
<div class="col-lg-12 col-md-12 ">
<article id="post-<?php the_ID(); ?>" <?php post_class('post-wrap '. $sticky_class); ?> >
<div class="blog grid-blog">
<?php if(has_post_thumbnail()){ ?>
<div class="blog-image-list">
<a href="<?php the_permalink(); ?>">
<?php
dreamsrent_content_thumbnail('dreamsrent_bloglist'); ?>
</a>
</div>
<?php } ?>
<div class="blog-content">
<div class="blog-list-date">
<p class="blog-category">
<?php
$categories_list = wp_get_post_categories($wp_query->post->ID);
$cats = array();
$output = '1';
foreach($categories_list as $c){
$cat = get_category( $c );
$cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug, 'url' => get_category_link($cat->cat_ID) ); ?>
<a href="<?php echo esc_url(get_term_link($cat->slug, 'category')) ?>"><span> <?php $single_cat_display= $cat->name; echo esc_html($single_cat_display); ?> </span></a>
<?php
$output++;
} ?>
</p>
<ul class="meta-item-list">
<li>
<div class="post-author">
<div class="post-author-img">
<?php echo get_avatar( get_the_author_meta('ID'), 30); ?>
</div>
<a href="javascript:void(0)"><span><?php the_author(); ?></span></a>
</div>
</li>
<li class="date-icon ms-3">
<i class="fa-solid fa-calendar-days"></i><span><?php echo get_the_date('',$post_id ); ?></span></li>
<?php
$comments = get_comments_number();
$comment_text ='';
if($comments >1)
{
$comment_count = esc_html(get_comments_number());
$comment_text = esc_html__(' Comments' ,'dreamsrent');
}
else if ($comments == 0)
{
$comment_count = '';
$comment_text = esc_html__('No Comments' ,'dreamsrent');
}
else
{
$comment_count = esc_html(get_comments_number());
$comment_text = esc_html__(' Comment' ,'dreamsrent');
}
?>
<li class="date-icon ms-3"><i class="fa-solid fa-comments"></i><span><?php echo esc_html($comment_count); ?><?php echo esc_html($comment_text); ?></span></li>
</ul>
</div>
<h3 class="blog-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<p class="blog-description"><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
<a href="<?php the_permalink(); ?>" class="viewlink btn btn-primary justify-content-center"><?php echo esc_html__('Read More','dreamsrent'); ?><i class="feather-arrow-right ms-2"></i></a>
</div>
</div>
</article>
</div>