<?php
/**
 * Template part for displaying posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Theme Palace
 * @subpackage Newstation
 * @since Newstation 1.0.0
 */

$options = newstation_get_theme_options();
$class = has_post_thumbnail() ? '' : 'no-post-thumbnail';

$ids = get_the_id();
$content = get_the_content($ids);
?>

<article id="post-<?php the_ID(); ?>" <?php post_class( $class ); ?>>

    <div class="featured-image" style="background-image: url('<?php echo (has_post_thumbnail( )) ? the_post_thumbnail_url( 'medium_large' ) : get_template_directory_uri().'/assets/uploads/no-featured-image-590x650.jpg' ?>');"></div>

    <div class="entry-container">
        <div class="entry-meta">
            <?php  
            if ( ! $options['hide_date'] ) {
                newstation_posted_on();
            }
            ?>

            <span class="min-read"><?php echo newstation_time_interval( $content ); echo esc_html__(' min read', 'newstation'); ?></span>

            <?php echo wp_kses_post(newstation_article_footer_meta()); ?>

        </div>

        <header class="entry-header">
            <h2 class="entry-title"><a href="<?php the_permalink(); ?>" tabindex="0"><?php the_title(); ?></a></h2>
        </header>

        <div class="entry-content">
            <p><?php the_excerpt(); ?></p>
        </div>

    </div>
</article>