<?php
/**
 * Template for loop posts
 * @since 1.0
 * @package RoyalNews
 */?>

<article <?php royalnews_schema_html_tag( 'article' ); ?> id="post-<?php the_ID(); ?>" <?php post_class( 'royalnews-blog' ); ?> >
    <div class="royalnews-post-wrapper">
        <?php if( has_post_thumbnail() ){
            $thumb = get_the_post_thumbnail_url();
        }else{
            $thumb = get_template_directory_uri() . '/assets/images/placeholder.jpg';
        }?>
        <div class="royalnews-post-thumbnail">
            <a href="<?php esc_attr( the_permalink() ); ?>">
                <img src="<?php echo esc_url( $thumb ); ?>">
            </a>
        </div>
        <div class="royalnews-post-info-wrapper">
            <div class="royalnews-post-cat">
                <?php royalnews_the_category(); ?>
            </div>
            <h2 class="royalnews-post-title">
                <a href="<?php esc_attr( the_permalink() ); ?>">            
                    <?php the_title(); ?>
                </a>
            </h2>
            <div class="royalnews-post-meta">
                <?php 
                    royalnews_posted_by( get_the_id() );
                    royalnews_the_date();  
                    royalnews_get_comment_number();                  
                ?>
            </div>
            <div class="royalnews-post-excerpt">        
                <?php the_excerpt(); ?>
            </div>
        </div>
    </div>
</article>
