<?php
/**
 * The template part for displaying services
 * @package Luxury Travel
 * @subpackage luxury_travel
 * @since 1.0
 */
?>
<?php 
  $luxury_travel_archive_year  = get_the_time('Y'); 
  $luxury_travel_archive_month = get_the_time('m'); 
  $luxury_travel_archive_day   = get_the_time('d'); 
?> 
<?php 
    $luxury_travel_grid_columns = get_theme_mod('luxury_travel_grid_columns', '3');
    if ($luxury_travel_grid_columns == '2') {
      $luxury_travel_column_class = 'col-lg-6 col-md-6';
    } elseif ($luxury_travel_grid_columns == '4') {
      $luxury_travel_column_class = 'col-lg-3 col-md-6';
    } elseif ($luxury_travel_grid_columns == '3') {
      $luxury_travel_column_class = 'col-lg-4 col-md-4';
    }
?>
<div class="<?php echo esc_attr($luxury_travel_column_class); ?>">
  <article class="grid-sec p-3 mb-4">
    <?php if(has_post_thumbnail() && get_theme_mod('luxury_travel_grid_post_featured_image',true) == true) { ?>
      <div class="mainimage">
        <?php the_post_thumbnail(); ?>   
      </div>
    <?php }?> 
    <h2 class="pt-0"><a href="<?php echo esc_url(get_permalink() ); ?>"><?php the_title(); ?><span class="screen-reader-text"><?php the_title(); ?></span></a></h2>
    <?php if(get_theme_mod('luxury_travel_grid_post_date',true) == 1 || get_theme_mod('luxury_travel_grid_post_author',true) == 1 || get_theme_mod('luxury_travel_grid_post_comment',true) == 1 || get_theme_mod( 'luxury_travel_grid_post_time',true) == 1){ ?>
      <div class="grid-post-info py-2">
        <?php if(get_theme_mod('luxury_travel_grid_post_date',true)==1){ ?>
          <i class="<?php echo esc_attr(get_theme_mod('luxury_travel_grid_post_date_icon',"fa fa-calendar pe-1" )); ?>"></i><a href="<?php echo esc_url( get_day_link( $luxury_travel_archive_year, $luxury_travel_archive_month, $luxury_travel_archive_day)); ?>"><span class="entry-date ms-1 me-2"><?php echo esc_html( get_the_date() ); ?></span><span class="screen-reader-text"><?php echo esc_html( get_the_date() ); ?></span></a>
        <?php }?>
        <?php if(get_theme_mod('luxury_travel_grid_post_author',true)==1){ ?>
          <i class="<?php echo esc_attr(get_theme_mod('luxury_travel_postauthor_icon',"fa fa-user pe-1" )); ?>"></i><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' )) ); ?>"><span class="entry-author ms-1 me-2"> <?php the_author(); ?></span><span class="screen-reader-text"><?php the_author(); ?></span></a>
        <?php }?>
        <?php if(get_theme_mod('luxury_travel_grid_post_comment',true)==1){ ?>
          <i class="<?php echo esc_attr(get_theme_mod('luxury_travel_grid_post_comment_icon',"fa fa-comments pe-1" )); ?>"></i><span class="entry-comments ms-1 me-2"> <?php comments_number( __('0 Comments','luxury-travel'), __('0 Comments','luxury-travel'), __('% Comments','luxury-travel') ); ?></span> 
        <?php }?>
        <?php if( get_theme_mod( 'luxury_travel_grid_post_time',true) != '') { ?>
          <i class="<?php echo esc_attr(get_theme_mod('luxury_travel_grid_post_time_icon',"fa fa-clock pe-1" )); ?>"></i><span class="entry-comments ms-1 me-2"><?php echo esc_html( get_the_time() ); ?></span>
        <?php }?>
      </div>
    <?php }?>
    <div class="entry-content">
	        		<p>
			          <?php $luxury_travel_theme_lay = get_theme_mod( 'luxury_travel_grid_post_content','Excerpt Content');
				          if($luxury_travel_theme_lay == 'Full Content'){ ?>
				            <?php the_content(); ?>
				          <?php }
				          if($luxury_travel_theme_lay == 'Excerpt Content'){ ?>
				            <?php if(get_the_excerpt()) { ?>
				              <?php $luxury_travel_excerpt = get_the_excerpt(); echo esc_html( luxury_travel_string_limit_words( $luxury_travel_excerpt, esc_attr(get_theme_mod('luxury_travel_grid_excerpt_number','20')))); ?> <?php echo esc_html( get_theme_mod('luxury_travel_grid_excerpt_suffix','...') ); ?>
				            <?php }?>
				          <?php }?>
			        </p>
	      </div>
    <?php if ( get_theme_mod('luxury_travel_grid_button_text','Read Full') != '' ) {?>
      <div class="blogbtn mt-3">
        <a href="<?php echo esc_url( get_permalink() );?>" class="blogbutton-small hvr-sweep-to-right"><?php echo esc_html( get_theme_mod('luxury_travel_grid_button_text',__('Read Full', 'luxury-travel')) ); ?><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('luxury_travel_grid_button_text',__('Read Full', 'luxury-travel')) ); ?></span></a>
      </div>
    <?php }?>
  </article>
</div>