<?php
  $content_type = get_theme_mod( 'vw_book_store_pro_post_content_blog','Excerpt Content');
  $excerpt_length="";
  if($content_type == "Excerpt Content"){
    $excerpt_length=get_theme_mod( 'vw_book_store_pro_excerpt_length',15);
  }
  $theme_lay = get_theme_mod( 'vw_book_store_pro_plugin_single_blog_option','two_col');

  if($theme_lay == 'one_col'){
    $col_class = 'col-md-12 col-sm-12';
  }else if($theme_lay == 'two_col'){
    $col_class = 'col-md-6 col-sm-6';
  }else{
    $col_class = 'col-md-4 col-sm-4';
  }
?>
<div class="<?php echo esc_attr($col_class); ?> mb-4">
  <div class="newsinner">
    <div class="collectionbox">
        <?php if ( get_theme_mod('vw_book_store_pro_blog_featured_image_enable',true) == "1" ) { ?>
      <?php if (has_post_thumbnail()){ ?>
        <?php the_post_thumbnail(); ?> 
         <div class="share_icon row p-0 m-0"> 
          <div class="share-title">
            <a href=""><i class="fas fa-share-alt"></i></a>
            </div>
                <p class="socila_share col-md-12 p-0">
                    <?php if(get_theme_mod('vw_book_store_pro_post_general_settings_post_share_facebook',true)==1 || get_theme_mod('vw_book_store_pro_post_general_settings_post_share_linkedin',true)==1 || get_theme_mod('vw_book_store_pro_post_general_settings_post_share_twitter',true)==1){ ?>
                      <?php } 
                     if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_share_facebook',true) == "1" ) { ?>
                        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo the_permalink(); ?>" target="_blank"><i class="fab fa-facebook-f"></i><span class="screen-reader-text"><?php echo esc_html('facebook.com', 'vw-book-store-pro' ) ; ?></span></a>
                    <?php } 

                    if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_share_linkedin',true) == "1" ) { ?>
                        <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&source=<?php the_title(); ?>" target="_blank"><i class="fab fa-linkedin-in"></i><span class="screen-reader-text"><?php echo esc_html('linkedin.com', 'vw-book-store-pro' ) ; ?></span></a>
                    <?php }

                    if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_share_twitter',true) == "1" ) { ?>
                        <a href="https://twitter.com/share?url=<?php the_permalink(); ?>&amp;text=<?php echo the_title(); ?>" target="_blank"><i class="fab fa-twitter"></i><span class="screen-reader-text"><?php echo esc_html('twitter.com', 'vw-book-store-pro' ) ; ?></span></a>
                    <?php } ?>
                </p>
            </div>                   
          <div class="collectionbox-content">
            <ul class="collectionicon">
              <li><a href="<?php the_permalink(); ?>"><i class="fa fa-link"></i></a></li>
              <?php if(get_theme_mod('vw_book_store_pro_toggle_comments',true) != ''){?>
                <li><a href="#"><i class="far fa-comments mr-2"></i><?php comments_number( __('0','vw-book-store-pro'), __('0','vw-book-store-pro'), __('%','vw-book-store-pro') ); ?></a></li>
              <?php } ?>
            </ul>
          </div>
          <?php if(get_theme_mod('vw_book_store_pro_toggle_date',true) != ''){?>
            <div class="post_date"><?php the_time(get_option('date_format')); ?></div>
          <?php } ?>
      <?php }} ?>
    </div>
    <div class="collectionbox-text">

      <h3><div class="divider"></div><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

      <?php if($content_type=="Excerpt Content"){  ?>
        <p><?php $excerpt = get_the_excerpt(); echo esc_html(vw_book_store_pro_string_limit_words($excerpt,$excerpt_length)); ?>
          <span>
            <?php echo esc_html(get_theme_mod('vw_book_store_pro_button_excerpt_suffix','[...]')); ?>
          </span>
        </p>
      <?php } if($content_type=="Full Content"){  ?>
        <?php the_content(); ?>
      <?php } ?>

      <?php if ( get_theme_mod('vw_book_store_pro_latestpost_readmore',true) != "" ) { ?>
        <div class="readmore">
          <a class="theme_white_button d-inline-block" href="<?php the_permalink(); ?>"><?php echo esc_html(get_theme_mod('vw_book_store_pro_latestpost_readmore'));?></a>
        </div>
      <?php }?> 
    </div>
  </div>
</div>
