<?php
/**
 * Template part for displaying single posts.
 *
 * @package tos
 */

?>


<div class="container-fluid no-padding">
   
   <?php
    if ( has_post_thumbnail()) : 
          //$img = the_post_thumbnail(); 
          $img_id = get_post_thumbnail_id();
          $img_url_array = wp_get_attachment_image_src($img_id, 'post-img');
          $img_url = $img_url_array[0];
    endif;
    $author_members = get_field('author_member');
      //var_dump($image);
      echo '<div class="img-up pull-left img-responsive" style="background: url('.$img_url_array[0].') center no-repeat; background-size:cover;"></div>';

?>

<div class="pink">
    <div class="container">
        <?php foreach ($author_members as $author_member) : ?>
        <?php
            $author_name = get_the_title($author_member->ID);
            $size = 'thumbnail';
            $author_image_attr = array(
                'class'	=> "attachment-$size img-responsive",
                'alt'	=> trim( strip_tags( $author_name ) ),
                'title'	=> trim( strip_tags( $author_name ) ),
            );
        ?>
         <div class="circle"><?php echo get_the_post_thumbnail($author_member->ID, $size, $author_image_attr); ?></div>
         <div class="author-info">
            <div class="pull">  
              <span class="post-title"><?php the_title(); ?></span>
              <span class="author"><?php echo $author_name; ?>, <?php the_time('d/m/Y'); ?></span>
            </div>
         </div>
        <?php endforeach; ?>
    </div>   
</div>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
   <div class="container padding">
       <p><?php the_content(); ?></p>
   </div>   
           
</article><!-- #post-## -->

</div>