generated from bisco/codex-bootstrap
fix: hide empty show metadata
This commit is contained in:
@@ -119,11 +119,13 @@ $features = array(
|
||||
$fallback = azionelab_asset( 0 === $show_index % 2 ? 'show-one.svg' : 'show-two.svg' );
|
||||
$image = get_the_post_thumbnail_url( get_the_ID(), 'large' ) ?: $fallback;
|
||||
$year = get_post_meta( get_the_ID(), 'azl_show_year', true );
|
||||
$year = '0' === (string) $year ? '' : $year;
|
||||
$location = get_post_meta( get_the_ID(), 'azl_show_location', true );
|
||||
$show_meta = implode( ' · ', array_filter( array( $year, $location ) ) );
|
||||
?>
|
||||
<article class="show-card">
|
||||
<img src="<?php echo esc_url( $image ); ?>" alt="Locandina di <?php the_title_attribute(); ?>" width="700" height="880" loading="lazy">
|
||||
<div class="show-copy"><p class="show-meta"><?php echo esc_html( trim( $year . ' · ' . $location, ' ·' ) ); ?></p><h3><?php the_title(); ?></h3><div><?php the_excerpt(); ?></div></div>
|
||||
<div class="show-copy"><?php if ( $show_meta ) : ?><p class="show-meta"><?php echo esc_html( $show_meta ); ?></p><?php endif; ?><h3><?php the_title(); ?></h3><div><?php the_excerpt(); ?></div></div>
|
||||
</article>
|
||||
<?php
|
||||
++$show_index;
|
||||
|
||||
Reference in New Issue
Block a user