Skip to content

Commit

Permalink
simplify event banner to avoid mobile render issues (fixes #912)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham committed Dec 11, 2024
1 parent e9919e6 commit b2d7500
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions web/wp-content/themes/cncf-twenty-two/components/event-banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
$mobile_image_id = get_post_meta( get_the_ID(), 'lf_event_mobile_banner', true );
$desktop_image_id = get_post_meta( get_the_ID(), 'lf_event_desktop_banner', true );
$external_url = get_post_meta( get_the_ID(), 'lf_event_external_url', true );
$alt_txt = the_title_attribute(
array(
'post' => get_the_ID(),
'echo' => 0,
)
);

?>
<a href="<?php echo esc_url( $external_url ); ?>" title="<?php the_title_attribute( get_the_ID() ); ?>">
Expand All @@ -18,20 +24,7 @@
srcset="<?php echo esc_url( wp_get_attachment_image_url( $mobile_image_id, 'full', false ) ); ?>">
<source media="(min-width: 500px)"
srcset="<?php echo esc_url( wp_get_attachment_image_url( $desktop_image_id, 'full', false ) ); ?>">
<?php
LF_Utils::display_responsive_images(
$desktop_image_id,
'full',
'1200px',
null,
'lazy',
the_title_attribute(
array(
'post' => get_the_ID(),
'echo' => 0,
)
)
);
?>
<img src="<?php echo esc_url( wp_get_attachment_image_url( $desktop_image_id, 'full', false ) ); ?>"
alt="<?php echo esc_attr( $alt_txt ); ?>">
</picture>
</a>

0 comments on commit b2d7500

Please sign in to comment.