File: /mnt/data/smarthr-co-in/wp-content/themes/dreamslanding/single-article.php
<?php get_header(); ?>
<?php
$blog_type ="col-lg-12 col-md-12";
?>
<div class="content1">
<?php
if (have_posts())
{
while ( have_posts() )
{
the_post();
$post_id = get_the_ID();
?>
<div class="blog-section blog_details <?php if (get_the_tags()) { ?> <?php } else { ?> not_tags <?php } ?>">
<div class="container">
<div class="row">
<div class="<?php echo esc_attr($blog_type); ?>">
<div class="card shadow-none border-0 blog-details mb-4 mb-lg-0">
<div class="card-body">
<div class="blog-content">
<?php if(has_post_thumbnail()){ ?>
<div class="blog-image mb-3">
<?php $thumb_url = get_the_post_thumbnail_url(get_the_ID(), 'large'); ?>
<img src="<?php echo esc_url($thumb_url); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid rounded">
</div>
<?php } ?>
<div class="d-flex align-items-center flex-wrap row-gap-2 mb-3">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" class=" d-flex align-items-center fs-16 text-gray-9 pe-3 border-end me-3 text-capitalize">
<?php echo get_avatar( get_the_author_meta('ID'), 32, '', '', array('class' => 'img-fluid avatar avatar-sm rounded-circle me-2') ); ?> <?php the_author(); ?>
</a>
<div class="pe-3 border-end me-3">
<span class="d-flex align-items-center fs-16 text-gray-9 "><i class="isax isax-calendar-2 me-1"></i><?php echo esc_html( get_the_date('j M Y', $post_id) ); ?></span>
</div>
<div>
<?php
$categories_blog = get_the_terms( $post->ID, 'category' );
if (is_array($categories_blog) || is_object($categories_blog)) {
foreach( $categories_blog as $category_blog ) { ?>
<a href="<?php echo esc_url( get_term_link($category_blog->slug, 'category') ); ?>" class="badge badge-sm badge-primary"><?php echo esc_html($category_blog->name); ?></a>
<?php } } ?>
</div>
</div>
<div class="mb-3">
<h2><?php the_title(); ?></h2>
</div>
<div class="blog-description entry-content">
<?php the_content(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
else
{
get_template_part( 'template-parts/blog/content', 'none' );
}
?>
</div>
<?php get_footer(); ?>