<?php
/**
 * Template part for displaying posts
 *
 * @subpackage Dinero
 * @since 1.0
 * @version 1.4
 */

?>

<article id="post-<?php the_ID(); ?>" <?php post_class('inner-service'); ?>>
  <div class="article_content blog-post">
    <div class="row mx-0">
      <?php if(has_post_thumbnail() && get_theme_mod ('dinero_show_thumbnail_image',true) == true) { ?>
        <div class="col-lg-5 col-md-12 pl-md-0">
          <?php the_post_thumbnail(); ?>
          <span class="entry-date"><i class="fas fa-calendar-alt"></i><?php echo esc_html( get_the_date()); ?></span>
        </div>
      <?php }?>
      <div class="<?php if(has_post_thumbnail() && get_theme_mod ('dinero_show_thumbnail_image',true) == true) { ?>col-lg-7 <?php } else {?> col-lg-12 <?php }?> col-md-12 py-4">
        <div class="metabox"> 
          <?php if (get_theme_mod('dinero_show_author',true) != false){ ?>
            <span class="entry-author"><i class="fas fa-user"></i><?php the_author(); ?></span>
          <?php }?>
          <?php if (get_theme_mod('dinero_show_comments',true) != false){ ?>
            <span class="entry-comments"><i class="fas fa-comments"></i><?php comments_number( __('0 Comments','dinero'), __('0 Comments','dinero'), __('% Comments','dinero') ); ?></span>
          <?php }?>
          <span class="entry-time"><i class="far fa-clock"></i><?php echo esc_html( get_the_time() ); ?></span>
        </div>
        <h3><?php the_title(); ?></h3>
        <p><?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt, esc_attr(get_theme_mod('dinero_blog_post_excerpt','20')) ) ); ?></p>
        <?php if (get_theme_mod('dinero_blog_post_button_text','Read More') != '') { ?>
          <div class="read-btn">
            <a href="<?php the_permalink(); ?>"><span><i class="fas fa-sign-in-alt"></i><?php echo  esc_html(get_theme_mod('dinero_blog_post_button_text',__('READ MORE','dinero'))); ?></span><span class="screen-reader-text"><?php echo  esc_html(get_theme_mod('dinero_blog_post_button_text',__('READ MORE','dinero'))); ?></span></a>
          </div>
        <?php }?>
      </div>
    </div>
    <?php if (get_theme_mod('dinero_show_category',false) != false) {?>
      <div class="blog-post-category px-4"><i class="fas fa-folder-open mr-2"></i><?php the_category(', '); ?></div>
    <?php }?>
    <?php if (get_theme_mod('dinero_show_tags',false) != false && get_the_tags()) {?>
      <div class="blog-post-tags mt-3 px-4">
        <i class="fas fa-tags mr-2"></i><?php echo get_the_tag_list('<p>',', ','</p>'); ?>
      </div>
    <?php }?>
    <div class="clearfix"></div>
  </div>
</article>