<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package ShoBe
 */
?>


<article <?php post_class('position-relative pb-5 '); ?>>
    <div class="date-box rounded shadow text-center bg-white position-absolute top-0 start-0 p-3 ms-3 mt-3">
        <h3 class="mb-0"><?php the_time( 'j' );?></h3>
        <p class="text-uppercase fw-medium mb-0"><?php the_time( 'M' );?></p>
    </div>
    <div class="post-preview mb-4">                            
    	<?php 
        	if( has_post_thumbnail() ): 
        		the_post_thumbnail( 'shobe-blog', array( 'class' => 'img-fluid rounded') );
        	endif;
    	?>                    
    </div>
    <div class="post pb-3">
        <p class="fs-12 text-meta">
            <i class="bi bi-person-vcard"></i> <?php esc_html_e( 'By: ', 'shobe' ); ?> <?php the_author_posts_link(); ?> 
            <?php if( has_category() ): ?>
                 <?php esc_html_e( '| In:', 'shobe' ); ?> <span><?php the_category( ', ' ); ?> | </span>
            <?php endif; ?>
           <i class="bi bi-chat-right-dots me-1"></i> 
           <a href="<?php echo esc_url( get_the_permalink());?>#comments" class="text-primary"><?php echo absint( get_comments_number() ); ?></a>
           
        </p>
        <h2 class="fs-22 fw-medium my-3 post-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> 

        <?php if( has_excerpt() ): ?>
            <p class="text-meta"> <?php the_excerpt(); ?></p>
        <?php elseif( strpos( $post->post_content, '<!--more-->' ) ): ?>
        <p class="text-meta"><?php the_content( 'Read More <i class="bi bi-arrow-right"></i>' ); ?></p>
        <?php else: ?>
            <p class="text-meta"><?php the_excerpt(); ?></p>
        <?php endif; ?>
    </div>
  
</article>