/home/moonrcjl/public_html/wp/wp-content/themes/arsha/template-parts/content-audio.php
<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package arsha
 */

$arsha_audio_url = function_exists( 'tpmeta_field' ) ? tpmeta_field( 'arsha_post_audio' ) : NULL;
$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-audio' );?>>
    <?php if(!empty($arsha_audio_url)) : ?>
    <div class="postbox__thumb ratio ratio-16x9">
        <?php echo wp_oembed_get( $arsha_audio_url ); ?>
    </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-audio' );?>>
    <?php if(!empty($arsha_audio_url)) : ?>
    <div class="mt-postbox-thumb ratio ratio-16x9">
        <?php echo wp_oembed_get( $arsha_audio_url ); ?>
    </div>
    <?php endif; ?>
    <div class="mt-postbox-content">
        <?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;?>