<?php
/**
 * The template part for displaying content
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since WPA Italia Digitale 2.2
 */


echo '<div class="Grid-cell usizefull u-sm-size1of2 u-md-size1of3 u-lg-size1of3 u-text-r-m u-margin-r-bottom ">
    <article class="Card Card--round Card--withBorder Card--shadow u-color-grey-30 u-background-white">
  <figure class="Card-image u-background-70 u-padding-all-s">';

    if(get_the_post_thumbnail(get_the_ID(), 'full')!=''){
    	$url = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()) );
	    echo '<a href="'.$url.'" data-lightbox="galleriaFoto">
	      <img src="'.$url.'" class="u-sizeFull" alt="5" />
	    </a>';
	}

	$listTerms=array();
	$terms = get_the_terms(get_the_ID() , 'album' );
	if ( $terms != null ){
	    echo '<figcaption class="u-padding-r-top">';
	    	echo '<span class="Icon Icon-camera u-color-grey-30 u-floatLeft u-text-r-l u-margin-right-xs" aria-hidden="true"></span>
		      <p class="u-color-grey-30 u-text-r-xs u-textWeight-700 u-padding-bottom-s">';
	    		foreach( $terms as $key => $term ) {
		            if ($key == end(array_keys($terms)))
		              echo $term->name;
		            else
		              echo $term->name.', ';
		          }
	    echo '</p></figcaption>';
	}

  echo '</figure>
  <div class="Card-content">
    <h2 class="Card-title u-textClean u-color-black u-text-r-s">
        '.get_the_title().'
    </h2>';
    the_content();
  echo '</div></article></div>';
?>