<?php
$src = wp_get_attachment_image_src(get_post_meta(get_the_ID(), 'evrst_cover', true), 'thumbnail');
$catalog_number = strtolower(get_post_meta(get_the_ID(), 'evrst_catalog_number', true));

$genres = array();

$genre_list = get_the_terms($post->ID, 'genre');

if ($genre_list) {
    foreach ($genre_list as $genre) {
        $genres[] = $genre->name;
    }
}


?>
<div class="album-wrapper"
     data-name="<?php echo sanitize_title($post->post_title); ?>"
     data-catalog-number="<?php echo $catalog_number; ?>"
     data-genre="<?php echo join(',', $genres); ?>"
	 data-tags="<?php echo
	  ($tags = get_the_tags() )
		  ? join( ',', array_map( 'evrst_tag_name', $tags ) )
		  : '';
	  ?>">
  <a href="<?php the_permalink(); ?>"><img src="<?php echo $src[0]; ?>" alt="cover" /></a>
  <div class="album-content"><?php the_content(); ?></div>
</div>
