<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Matthew_Magazine_Blog
 */
?>
<?php
//    $get_thumbnail_url = get_the_post_thumbnail_url( get_the_ID() );
    $get_thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'matthew-magazine-blog-image-medium' );
    $get_permalink = get_permalink();
    $post = get_post();
    $post_format = get_post_format($post) ? : 'standard';
?>

<div class="post-masonry__item--inner border-default">
    <?php if($post_format != 'quote'): ?>
        <div class="position-relative">
            <div class="post-masonry__image">
                <a href="<?php echo esc_html($get_permalink); ?>">
                    <img src="<?php echo esc_html($get_thumbnail_url); ?>" alt="<?php echo get_the_title() ?>" />
                </a>
            </div>
            <div class="post-masonry__content">
                <div class="post-masonry__content--inner">
                    <h3 class="post-masonry__title"><a href="<?php echo esc_html($get_permalink); ?>"><?php echo get_the_title() ?></a></h3>
                    <?php matthew_magazine_blog_entry_options($post, array('class' => 'justify-content-center', 'entry_date' => true, 'entry_cat' => true, 'entry_author' => true)); ?>
                </div>
            </div>
        </div>
    <?php else: ?>
        <div class="post-masonry__content">
            <?php matthew_magazine_blog_entry_options($post, array('class' => 'justify-content-center', 'entry_date' => true, 'entry_cat' => true, 'entry_author' => true)); ?>
            <h3 class="post-masonry__title"><a href="<?php echo esc_html($get_permalink); ?>"><?php echo get_the_title() ?></a></h3>
            <div class="post-masonry__sub">
                <?php echo get_the_excerpt(get_the_ID()); ?>
            </div>
            <div class="post-masonry__btn">
                <a href="<?php echo esc_html($get_permalink); ?>" title="<?php echo get_the_title() ?>"><?php esc_html_e( 'Discover More','matthew-magazine-blog' ); ?></a>
            </div>
        </div>
        <div class="bg-cover"></div>
    <?php endif; ?>
</div>
