File: //home/l2pbkn5l6xav/www/wp-content/themes/charity-fundraiser/template-parts/content-audio.php
<?php
/**
* The template part for displaying post
* @package Charity Fundraiser
* @subpackage charity_fundraiser
* @since 1.0
*/
?>
<?php
$content = apply_filters( 'the_content', get_the_content() );
$audio = false;
// Only get audio from the content if a playlist isn't present.
if ( false === strpos( $content, 'wp-playlist-script' ) ) {
$audio = get_media_embedded_in_content( $content, array( 'audio' ) );
}
?>
<div class="blog-sec animated fadeInDown">
<div class="mainimage">
<?php
if ( ! is_single() ) {
// If not a single post, highlight the audio file.
if ( ! empty( $audio ) ) {
foreach ( $audio as $audio_html ) {
echo '<div class="entry-audio">';
echo $audio_html;
echo '</div><!-- .entry-audio -->';
}
};
};
?>
</div>
<h3><a href="<?php echo esc_url(get_permalink() ); ?>"><?php the_title(); ?></a></h3>
<div class="post-info">
<i class="fa fa-calendar" aria-hidden="true"></i><span class="entry-date"><?php the_date(); ?></span>
<i class="fa fa-user" aria-hidden="true"></i><span class="entry-author"> <?php the_author(); ?></span>
<i class="fa fa-comments" aria-hidden="true"></i><span class="entry-comments"> <?php comments_number( __('0 Comments','charity-fundraiser'), __('0 Comments','charity-fundraiser'), __('% Comments','charity-fundraiser') ); ?></span>
</div>
<p><?php the_excerpt(); ?></p>
<div class="blogbtn">
<a href="<?php echo esc_url( get_permalink() );?>" class="blogbutton-small hvr-sweep-to-right" title="<?php esc_attr_e( 'Read Full', 'charity-fundraiser' ); ?>"><?php esc_html_e('Read Full','charity-fundraiser'); ?></a>
</div>
</div>