<?php
/**
 * Template part for displaying posts
 * 
 * @subpackage lz-interior-decor
 * @since 1.0
 * @version 1.4
 */
?>
<?php 
  $archive_year  = get_the_time('Y'); 
  $archive_month = get_the_time('m'); 
  $archive_day   = get_the_time('d'); 
?>
<?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' ) );
  }
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('inner-service'); ?>>
  <div class="article_content">
    <?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 class="article-text">
        <h3><?php the_title(); ?></h3>
        <div class="metabox">
         <a href="<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day)); ?>"><span class="entry-date"><?php the_time( get_option( 'date_format' ) ); ?></span><span class="screen-reader-text"><?php the_time( get_option( 'date_format' ) ); ?></span></a>
          <span class="entry-author"><?php the_author(); ?></span>
          <span class="entry-comments"><?php comments_number( __('0 Comments','lz-interior-decor'), __('0 Comments','lz-interior-decor'), __('% Comments','lz-interior-decor') ); ?></span>
        </div>
        <div class="text-content"><p><?php $excerpt = get_the_excerpt();echo esc_html( lz_interior_decor_string_limit_words( $excerpt,30 ) ); ?></p></div>
        <div class="read-btn">
          <a href="<?php echo esc_url( get_permalink() );?>" class="blogbutton-small"><?php esc_html_e('READ MORE','lz-interior-decor'); ?><i class="fas fa-angle-double-right"></i><span class="screen-reader-text"><?php esc_html_e('READ MORE','lz-interior-decor'); ?></span>
          </a>
        </div>
      </div>
      <div class="clearfix"></div> 
  </div>
</article>