<?php
/*
*Template Name: Blog Page
*/


get_header(); ?>

<div id="primary" class="content-area">
   <main id="main" class="site-main" role="main">
       <div class="blog_block_main">
              <div class="container-fluid">

                <div class="row">
                       
                   <div id="blog_items">

                    <?php query_posts('post_type=post&post_status=publish&paged='. get_query_var('paged')); ?>

                    <?php if( have_posts() ): ?>
                     
                        <?php while( have_posts() ): the_post(); ?>
                         <div class="blog_box blog_box_2">	
                           <a href="<?php the_permalink(); ?>">
                            <div class="blog-img">
                                <?php 

                                    if ( has_post_thumbnail() ) {

                                        the_post_thumbnail('isotop-img', array('class' => 'img-responsive', 'title' => get_the_title()));

                                    } else { ?>

                                        <img src="<?php echo get_template_directory_uri(); ?>/img/inst1.jpg" alt="No Image" class="img-responsive" style=" width: 455px;height: 305px;" />

                                <?php } ?>
                            </div>
							</a>
                            <?php $author_members = get_field('author_member'); ?>
                            <?php foreach ($author_members as $author_member) : ?>
                            <?php
                                $author_name = get_the_title($author_member->ID);
                            ?>
                            
                            
                           <div class="pink">

                                  <a href="<?php the_permalink(); ?>"> <span class="post-title"><?php the_title(); ?></span></a>
                                  <span class="author"><?php echo $author_name; ?>, <?php the_time('d/m/Y'); ?></span>

                            </div>
                            <?php endforeach; ?>
                            
                            
                            

                        </div><!--/blog_box blog_box_2---->
                        <?php endwhile; ?>


                     <?php endif; wp_reset_query(); ?>
                    </div><!--/blog_items--->

                    <div class="clearfix"></div>
                  </div>
                </div>
           </div><!--/ blog_block_main----->

    </main><!--/ #main -->
</div><!--/ #primary -->

<?php //get_sidebar(); ?>
<?php get_footer(); ?>
