<?php
/**
 * Template part for displaying page content in page.php.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Hotel 26
 */
?>

<article id="post-<?php the_ID(); ?>"  <?php post_class('post-items wow fadeIn'); ?> data-wow-delay="100ms" data-wow-duration="1500ms">
    <figure class="post-image">
        <?php if (has_post_thumbnail() ) { ?>
        <div class="featured-image">
            <a href="<?php echo esc_url(get_permalink()); ?>">
            <?php the_post_thumbnail(); ?>
            </a>
            <div class="hover-links">
                <a href="<?php echo esc_url(get_permalink()); ?>" class="blog-share">
                    <i class="fa fa-link"></i>
                </a>
            </div>
        </div>
        <?php } ?>
        <div class="post-meta">
            <div class="meta-top">
                <span class="post-tags">
                    <i class="fa fa-tags i-hexa"></i>
                    <?php the_tags(''); ?>                    
                </span>
                <span class="post-date">
                    <a href="<?php echo esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))); ?>">
                        <span><i class="fa fa-calendar"></i></span> <?php echo esc_html(get_the_date('j')); ?> <?php echo esc_html(get_the_date('M')); ?> <?php echo esc_html(get_the_date('Y')); ?>
                    </a>
                </span>
            </div>
            <div class="meta-bottom">
                <span class="author-name">
                    <i class="fa fa-user i-hexa"></i>
                    <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID')));?>"><?php echo esc_html('By', 'hotel-26'); ?> <?php esc_html(the_author()); ?></a>
                </span>
                <span class="blog-category">
                    <i class="fa fa-folder-open i-hexa"></i>
                    <?php the_category(', '); ?>
                </span>
            </div>
        </div>
    </figure>
    <div class="post-content">
        <?php     
        if (is_single() ) :
            
            the_title('<h5 class="post-title">', '</h5>');
            
            else:
            
                the_title(sprintf('<h5 class="post-title"><a href="%s" rel="bookmark" class="ellipsis">', esc_url(get_permalink())), '</a></h5>');
            
            endif;
            
            echo the_content(
                sprintf(
                /* Translators: 1: Button Label 2: Post Title 3: Button Link */
                    '<a class="more-link btn btn-primary" href="%3$s">%1$s<span class="screen-reader-text"> %2$s</span></a>',
                    esc_html__('Read More', 'hotel-26'),
                    esc_html(get_the_title()),
                    esc_url(get_permalink())
                )
            );
            ?>
        <a href="<?php echo get_comments_link(); ?>" class="comments"><i class="fa fa-comments"></i>(<?php echo get_comments_number(); ?>)</a>
    </div>
</article>
