<?php
/**
* Template part for displaying posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package arsha
*/
$arsha_video_url = function_exists('tpmeta_field')? tpmeta_field('arsha_post_video') : '';
$categories = get_the_terms( $post->ID, 'category' );
$arsha_blog_cat = get_theme_mod( 'arsha_blog_cat', false );
$arsha_social_share_switch = get_theme_mod( 'arsha_social_share_switch', false );
$tag_col_number= $arsha_social_share_switch ? "col-lg-7" : "col-12";
if ( is_single() ):
?>
<article id="post-<?php the_ID();?>" <?php post_class( 'mt-postbox mb-60 format-video' );?>>
<?php if(has_post_thumbnail()) : ?>
<div class="mt-postbox-thumb p-relative">
<?php the_post_thumbnail('full'); ?>
<?php if(!empty($arsha_video_url)) : ?>
<div class="mt-blog-video">
<a class="popup-video" href="<?php echo esc_url($arsha_video_url); ?>"><i class="fal fa-play"></i></a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="mt-postbox-content mb-50">
<!-- Blog Meta -->
<?php get_template_part( 'template-parts/blog/blog-meta' ); ?>
<h3 class="mt-postbox-title mt-fs-40 mb-30"><?php the_title(); ?></h3>
<div class="mt-postbox-details">
<?php the_content(); ?>
<div class="mt-postbox-tag-wrapper mt-50">
<div class="row align-items-center">
<div class="<?php echo esc_attr($tag_col_number); ?>">
<div class="mt-postbox-tag mb-30">
<span><?php echo esc_html__('Tag:','arsha'); ?></span>
<?php
$tags = get_the_tags(); // Assuming you are within the loop
if ($tags) {
foreach ($tags as $tag) {
echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>';
}
}
?>
</div>
</div>
<?php if(function_exists('arsha_blog_social_share') && !empty($arsha_social_share_switch)) : ?>
<div class="col-lg-5">
<div class="mt-postbox-social mb-30 text-start text-lg-end">
<?php arsha_blog_social_share(); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</article>
<?php else: ?>
<article id="post-<?php the_ID();?>" <?php post_class( 'mt-postbox mb-60 format-video' );?>>
<?php if(has_post_thumbnail()) : ?>
<div class="mt-postbox-thumb p-relative">
<?php the_post_thumbnail('full'); ?>
<?php if(!empty($arsha_video_url)) : ?>
<div class="mt-blog-video">
<a class="popup-video" href="<?php echo esc_url($arsha_video_url); ?>"><i class="fal fa-play"></i></a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="mt-postbox-content">
<!-- blog meta -->
<?php get_template_part( 'template-parts/blog/blog-meta' ); ?>
<h3 class="mt-postbox-title mb-20"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="postbox__text">
<?php the_excerpt(); ?>
</div>
<!-- blog btn -->
<?php get_template_part( 'template-parts/blog/blog-btn' ); ?>
</div>
</article>
<?php
endif;?>