<?php global $shapebootstrap_options; ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
        <span class="post-format">
            <i class="fa fa-picture-o"></i>
        </span>

        <h2 class="entry-title">
            <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
            <?php if ( is_sticky() && is_home() && ! is_paged() ) { ?>
            <sup class="featured-post"><?php _e( 'Sticky', 'shapebootstrap' ) ?></sup>
            <?php } ?>
        </h2> <!-- //.entry-title -->

        <?php get_template_part( 'post-format/entry-meta' ); ?> 

    </header> <!--/.entry-header -->

    <div class="entry-gallery">
        <?php $slides = rwmb_meta('thm_gallery_images','type=image_advanced'); ?>
        <?php $count = count($slides); ?>
        <?php if($count > 0): ?>


                <!-- Wrapper for slides -->
                <ul class="gallery-format">

                    <?php $slide_no = 1; ?>

                    <?php foreach( $slides as $slide ): ?>

                        <?php
                            $images = wp_get_attachment_image_src( $slide['ID'], 'xs-blog-gallery' );

                            if (is_page_template('blog-full-width.php') || is_page_template('blog-masonry-col3.php') || is_page_template('blog-masonry-col4.php') || is_page_template('blog-masonry-col2.php')) {
                                $images = wp_get_attachment_image_src( $slide['ID'], 'blog-gallery' );
                            }
                            
                            $full_images = wp_get_attachment_image_src( $slide['ID'], 'full' );
                        ?>
                        <li>
                            <img class="img-responsive" src="<?php echo $images[0]; ?>" alt="">
                            <div class="overlay">
                                <a href="<?php echo $full_images[0]; ?>" data-rel="prettyPhoto"><?php _e( 'Preview', 'shapebootstrap' ) ?></a>
                            </div>
                        </li>
                        <?php $slide_no++ ?>
                    <?php endforeach; ?>

                </ul>

        <?php endif; ?>
    </div>
    
    <div class="entry-summary">
        <?php if ( is_single() ) {
            the_content();
        } else {
            the_excerpt();  
        } 
        wp_link_pages( array(
            'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'shapebootstrap' ) . '</span>',
            'after'       => '</div>',
            'link_before' => '<span>',
            'link_after'  => '</span>',
        ) );

        ?>
    </div> <!-- //.entry-summary -->
    
    <?php
     if (isset($shapebootstrap_options['blog-social']) && $shapebootstrap_options['blog-social'] ){
        if(is_single()) {
            get_template_part( 'post-format/social-buttons' );
        } else {
            get_template_part( 'post-format/social-buttons' ); 
        } 
    }
    ?>

</article> <!--/#post -->