<?php
/**
 * @package _spx
 */
?>

<?php
$thumb = esc_url(get_template_directory_uri() . '/theme-assets/img/blog/post-thumbnail.jpg');
if (has_post_thumbnail()) {
    $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');
    $thumb = $large_image_url[0];
}
?>
<!--start-blog-post-->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
    <div class="blog-index-post">
        <figure class="post-thumbnail <?php
        if (!has_post_thumbnail()) {
            echo 'no-thumb-archive';
        }
        ?>">
                <?php xs_posted_on($post->ID); ?>
            <a href="<?php echo get_post_permalink($post->ID); ?>" title="<?php echo esc_html($post->post_title); ?>" class="hoverImg">
                <i class="fa fa-chain"></i>
                <?php
                if (has_post_thumbnail()) {
                    $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'wide');
                    $thumb = $large_image_url[0];
                    echo '<img src="' . $large_image_url[0] . '" alt="' . the_title_attribute('echo=0') . '" class="img-responsive" />';
                }
                ?>
            </a>
        </figure>
        <header class="post-header">
            <div class="row">
                <div class="col-md-1 col-sm-2 col-xs-2">
                    <span class="post-icon"><i class="fa fa-file-text-o"></i></span>
                </div>
                <div class="col-md-11 col-sm-10 col-xs-10">
                    <h5><a href="<?php echo get_post_permalink($post->ID); ?>" title="<?php echo esc_html($post->post_title); ?>"><?php echo esc_html($post->post_title); ?></a></h5>
                    <small class="text-muted">
                        <?php
                        

                        if (get_post_meta($post->ID, 'xs_post_show_category', true) != 'off') {
                             xs_posted_cat();
                        }
                        if (get_post_meta($post->ID, 'xs_post_show_author', true) != 'off') {
                            xs_posted_by($post->post_author);
                        }
                        ?>                            	
                    </small>
                </div>
            </div>
        </header>
        <div class="post-content">
            <p><?php echo the_excerpt_max_charlength(140); ?></p>
            <p class="post-footer"><a href="<?php echo get_post_permalink($post->ID); ?>" title="<?php echo __('Read More', 'xs'); ?>" class="btn btn-default"><?php echo __('Read More', 'xs'); ?> <i class="fa fa-angle-right"></i></a></p>
            <hr>
<?php xs_post_tags(); ?>
        </div>
    </div>
</div><!--end-of-blog-index-post-->