<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Korik
 */
if ( ! is_singular( ) ) : ?>

<div class="col-lg-4">
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <div class="blog-card">           
            <div class="blog-card-img-wrap">
                <div class="post-thumbnail">
                    <?php if(has_post_thumbnail() ): 
                    korik_post_thumbnail(); 
                    else : ?>
                    <a href="<?php echo esc_url( get_permalink() ); ?>"><img src="<?php echo esc_url (get_stylesheet_directory_uri() . '/assets/img/01.jpg' ); ?>" alt="<?php the_title(); ?>"></a>
                    <?php endif; ?>		
                </div><!-- .post-thumbnail -->
                <ul> <li><?php korik_category(); ?></li></ul>
            </div>
                                                                                                            
            <div class="blog-content">
                <ul class="blog-meta">
                    <li><?php korik_posted_by(); ?></li>
                    <li><?php korik_posted_on(); ?></li>
                </ul>   
                <?php the_title( '<h4><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h4>' ); ?>                 
            </div>                                
        </div>
    </article>
</div>
    
<?php else: ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php if ( has_post_thumbnail () ): ?>
        <?php korik_post_thumbnail(); ?>
    <?php endif; ?>
    <div class="post-content">
        <ul class="blog-meta">
            <li><?php korik_posted_by(); ?></li>
            <li><?php korik_posted_on(); ?></li>
        </ul>  

        <div class="entry-content">
            <?php

            if(is_single( )){
                the_content(
                    sprintf(
                        wp_kses(
                            /* translators: %s: Name of current post. Only visible to screen readers */
                            __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'korik' ),
                            array(
                                'span' => array(
                                    'class' => array(),
                                ),
                            )
                        ),
                        wp_kses_post( get_the_title() )
                    )
                );
            }else{
                the_excerpt();
            }
            wp_link_pages(
                array(
                    'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'korik' ),
                    'after'  => '</div>',
                )
            );
            ?>
        </div><!-- .entry-content -->

        <?php if ( is_singular() ) : ?>
            <footer class="entry-footer">
                <?php korik_entry_footer(); ?>
            </footer><!-- .entry-footer -->
        <?php endif; ?>
    </div>
</article>
<?php endif; ?>