<?php
/**
 * The template part for displaying slider
 *
 * @package Medical Supplements Store
 * @subpackage medical_supplements_store
 * @since Medical Supplements Store 1.0
 */
?>
<?php 
  $archive_year  = get_the_time('Y'); 
  $archive_month = get_the_time('m'); 
  $archive_day   = get_the_time('d'); 
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('inner-service'); ?>>
  <div class="services-box wow zoomInLeft delay-2000 mb-4">
    <div class="post-box">
      <?php if(has_post_thumbnail() && get_theme_mod( 'medical_supplements_store_feature_image_hide',true) != '') { ?>
        <div class="service-image">
          <a href="<?php echo esc_url( get_permalink() ); ?>">
            <?php the_post_thumbnail(); ?>
          </a>
          <div class="middle">
            <div class="text"><i class="fas fa-th-large"></i></div>
          </div>
        </div>
      <?php }?>
      <div class="lower-box">
        <div class="tc-category">
          <?php the_category(); ?>
        </div>
        <h2 class="py-3"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php esc_html(the_title()); ?><span class="screen-reader-text"><?php esc_html(the_title()); ?></span></a></h2>
        <?php if( get_theme_mod( 'medical_supplements_store_date_hide',true) != '' || get_theme_mod( 'medical_supplements_store_comment_hide',true) != '' || get_theme_mod( 'medical_supplements_store_author_hide',true) != '' || get_theme_mod( 'medical_supplements_store_time_hide',true) != '') { ?>
          <div class="metabox py-1 px-2 mb-3">
            <?php if( get_theme_mod( 'medical_supplements_store_date_hide',true) != '') { ?>
              <span class="entry-date me-2"><i class="<?php echo esc_attr(get_theme_mod('medical_supplements_store_postdate_icon', 'far fa-calendar-alt me-1')); ?>"></i><a href="<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day)); ?>"><?php echo esc_html( get_the_date() ); ?><span class="screen-reader-text"><?php echo esc_html( get_the_date() ); ?></span></a></span>
            <?php } ?>

            <?php if( get_theme_mod( 'medical_supplements_store_author_hide',true) != '') { ?>
              <span class="entry-author me-2"><i class="<?php echo esc_attr(get_theme_mod('medical_supplements_store_author_icon', 'fas fa-user me-1')); ?>"></i><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' )) ); ?>"><?php esc_html(the_author()); ?><span class="screen-reader-text"><?php esc_html(the_author()); ?></span></a></span>
            <?php } ?>

            <?php if( get_theme_mod( 'medical_supplements_store_comment_hide',true) != '') { ?>
              <span class="entry-comments me-2"><i class="<?php echo esc_attr(get_theme_mod('medical_supplements_store_comment_icon', 'fa fa-comments me-1')); ?>"></i><?php comments_number( __('0 Comment', 'medical-supplements-store'), __('0 Comments', 'medical-supplements-store'), __('% Comments', 'medical-supplements-store') ); ?> </span>
            <?php } ?>

            <?php if( get_theme_mod( 'medical_supplements_store_time_hide',true) != '') { ?>
              <span class="entry-time me-2"><i class="<?php echo esc_attr(get_theme_mod('medical_supplements_store_time_icon', 'fas fa-clock me-1')); ?>"></i> <?php echo esc_html( get_the_time() ); ?></span>
            <?php }?>
          </div>
        <?php } ?>
        <?php if(get_theme_mod('medical_supplements_store_post_content') == 'Full Content'){ ?>
          <?php the_content(); ?>
        <?php }
        if(get_theme_mod('medical_supplements_store_post_content', 'Excerpt Content') == 'Excerpt Content'){ ?>
          <?php if(get_the_excerpt()) { ?>
            <p><?php $medical_supplements_store_excerpt = get_the_excerpt(); echo esc_html( medical_supplements_store_string_limit_words( $medical_supplements_store_excerpt, esc_attr(get_theme_mod('medical_supplements_store_post_excerpt_length','20')))); ?><?php echo esc_html( get_theme_mod('medical_supplements_store_button_excerpt_suffix','[...]') ); ?></p>
          <?php }?>
        <?php }?>
        <?php if ( get_theme_mod('medical_supplements_store_post_button_text','Read More') != '' ) {?>
          <div class="service-btn mt-4 mb-2">
            <a href="<?php echo esc_url(get_permalink()); ?>" title="<?php esc_attr_e('Read More','medical-supplements-store'); ?>"><?php echo esc_html( get_theme_mod('medical_supplements_store_post_button_text',__( 'Read More','medical-supplements-store' )) ); ?><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('medical_supplements_store_post_button_text',__( 'Read More','medical-supplements-store' )) ); ?></span></a>
          </div>
        <?php }?>
      </div>
    </div>
  </div>
</article>