Skip to content

Instantly share code, notes, and snippets.

@cinghaman
Created September 8, 2022 09:18
Show Gist options
  • Save cinghaman/0c9bd2b7b83838ec4706c8794ad2b3e1 to your computer and use it in GitHub Desktop.
Save cinghaman/0c9bd2b7b83838ec4706c8794ad2b3e1 to your computer and use it in GitHub Desktop.
FilterWP and MetaBox
<?php
$speaker_name = rwmb_meta( 'speaker_name' ); // meta fields
$speaker_role = rwmb_meta( 'speaker_role' );
$video_link = rwmb_meta( 'video_link' );
$speaker_talk_title = rwmb_meta( 'speaker_talk_title' );
$images = rwmb_meta( 'speaker_image', array( 'size' => 'full' ) );
?>
<div class="card" data-fancybox href="<?php echo $video_link; ?>" data-width="640" data-height="360">
<div class="card-thumbnail">
<?php
foreach ( $images as $image ) {
echo '<span><img src="', $image['url'], '" alt="', $image['title'], '" width="', $image['width'], '" height="', $image['height'], '"></span>';
}
?>
</div>
<div class="card-play">
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" class="svg-inline--fa fa-play fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>
</div>
<div class="card-overlay"></div>
<div class="card-content">
<div class="card-content__bottom">
<h3 class="card-speaker-title"><?php echo $speaker_talk_title; ?></h3>
<h4 class="card-speaker-name"><?php echo $speaker_name; ?></h4>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment