OwlCyberSecurity - MANAGER
Edit File: single-sermon.php
<?php if ( !defined( 'ABSPATH' ) ) exit(); get_header( ); $id = get_the_ID(); $video = get_post_meta($id,'ova_sermon_met_video',true); $audio = get_post_meta($id,'ova_sermon_met_audio',true); $document = get_post_meta($id,'ova_sermon_met_document',true); $date = get_post_meta($id,'ova_sermon_met_date',true); $feature_image = get_the_post_thumbnail_url( $id, 'full' ); if ( $feature_image == '') { $feature_image = \Elementor\Utils::get_placeholder_image_src(); } // Category $category = get_the_terms($id, 'cat_sermon'); // Sermon by $sermon_by = get_the_terms($id, 'sermon_by'); // Publish Date $publish_date = get_the_time(get_option('date_format').' @ '.get_option('time_format'), $id); ?> <div class="row_site"> <div class="container_site"> <div class="ova_sermon_single"> <?php if( !empty($video) || !empty($audio) || !empty($document) ) { ?> <div class="sermon-media"> <div class="watch-wrapper"> <span class="text"> <?php echo esc_html__('Watch now','chursy');?> </span> <div class="sermon-watch"> <?php if( !empty($video) ) { ?> <a href="<?php echo esc_url( $video ); ?>" data-fancybox="sermon-video" data-src="<?php echo esc_attr( $video ); ?>" class="item-media video" aria-label="<?php esc_attr_e('Watch video','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-play"></i> </a> <?php } ?> <?php if( !empty($audio) ) { ?> <a href="<?php echo esc_url( $audio ); ?>" data-fancybox="sermon-audio" data-src="<?php echo esc_attr( $audio ); ?>" data-type="html5video" class="item-media audio" aria-label="<?php esc_attr_e('Watch audio','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-music"></i> </a> <?php } ?> <?php if( !empty($document) ) { ?> <a href="<?php echo esc_url( $document ); ?>" target="_blank" class="item-media document" aria-label="<?php esc_attr_e('View document','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-file-alt"></i> </a> <?php } ?> </div> </div> <div class="download-wrapper"> <span class="text"> <?php echo esc_html__('Download now','chursy');?> </span> <div class="sermon-download"> <?php if( !empty($video) ) { ?> <a href="<?php echo esc_url($video);?>" download class="item-media video" aria-label="<?php esc_attr_e('Download video','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-play"></i> </a> <?php } ?> <?php if( !empty($audio) ) { ?> <a href="<?php echo esc_url($audio);?>" download class="item-media audio" aria-label="<?php esc_attr_e('Download audio','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-music"></i> </a> <?php } ?> <?php if( !empty($document) ) { ?> <a href="<?php echo esc_url($document);?>" download class="item-media document" aria-label="<?php esc_attr_e('Download document','ova-sermon');?>"> <i aria-hidden="true" class="fas fa-file-alt"></i> </a> <?php } ?> </div> </div> </div> <?php } ?> <div class="sermon-feature-img"> <?php if( ! empty( $feature_image ) ){ ?> <img src="<?php echo esc_url( $feature_image ) ?>" alt="<?php echo get_the_title() ?>"> <?php } ?> </div> <div class="info"> <div class="summary_info"> <?php if( !empty($date) ) { ?> <div class="top-info"> <div class="calendar"> <i class="far fa-calendar-alt"></i> <div class="start-date"> <?php echo esc_html( $date );?> </div> </div> </div> <?php } ?> <h2 class="title"> <?php echo get_the_title() ?> </h2> <ul class="info-contact"> <?php if ( !empty($sermon_by) ) : ?> <li> <span class="label"><?php esc_html_e('Sermon by:','ova-sermon'); ?></span> <span class="info"> <?php $arr_link = array(); foreach( $sermon_by as $by ) { $sermon_by_link = get_term_link($by->term_id); if ( $sermon_by_link ) { $link = '<a href="'.esc_url( $sermon_by_link ).'" title="'.esc_attr($by->name).'">'.$by->name.'</a>'; array_push( $arr_link, $link ); } } if ( !empty( $arr_link ) && is_array( $arr_link ) ) { echo join(' & ', $arr_link); } ?> </span> </li> <?php endif; ?> <?php if ( !empty($category) ) : ?> <li> <span class="label"><?php esc_html_e('Category:','ova-sermon'); ?></span> <span class="info"> <?php $arr_link = array(); foreach( $category as $cat ) { $category_link = get_term_link($cat->term_id); if ( $category_link ) { $link = '<a href="'.esc_url( $category_link ).'" title="'.esc_attr($cat->name).'">'.$cat->name.'</a>'; array_push( $arr_link, $link ); } } if ( !empty( $arr_link ) && is_array( $arr_link ) ) { echo join(', ', $arr_link); } ?> </span> </li> <?php endif; ?> <li> <span class="label"><?php esc_html_e('Date:','ova-sermon'); ?></span> <span class="info"> <?php echo esc_html( $publish_date ); ?> </span> </li> </ul> </div> <div class="main_content"> <h2 class="title"> <?php echo get_the_title() ?> </h2> <div class="description"> <?php if( have_posts() ) : while( have_posts() ) : the_post(); the_content(); endwhile; endif; wp_reset_postdata(); ?> </div> <?php if( comments_open( get_the_ID() ) ) { comments_template(); } ?> </div> </div> </div> </div> </div> <?php get_footer( );