Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul class="event-list">
- <?php
- $speaker_posts = new WP_Query([
- 'post_type' => 'speakers',
- 'meta_query' => [
- [
- 'key' => '2021_speaker',
- 'value' => '1',
- 'compare' => '=',
- ],
- ],
- ]);
- if ( $speaker_posts->have_posts() ) :
- while ( $speaker_posts->have_posts() ) : $speaker_posts->the_post();
- // THIS PART IS THE WONKY BIT
- if ($speaker_posts) :
- foreach ($speaker_post as $speaker) :
- $label = '';
- $mod = get_field('moderator', $speaker->ID);
- $intr = get_field('intro_speaker', $speaker->ID);
- if ($mod == true) :
- $label = ' <span style="color:' . get_field('primary_branding_color', 'options') . '">(moderator)</span>';
- endif;
- if ($intr == true) :
- $label = ' <span style="color: #35a6c4">(introduction)</span>';
- endif;
- ?>
- // WONKY END
- <?php
- $img_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'headshot' );
- ?>
- <li class="module">
- <a class='iframe' href="<?php the_permalink(); ?>">
- <div class="portrait">
- <div class="portrait headshot" title="<?php the_title_attribute(); ?>">
- <?php echo the_post_thumbnail('medium'); ?></div>
- </div>
- <div class="inline-content">
- <div id="custom-bg" style="background-image: url('<?php echo $image[0]; ?>')"></div>
- <div class="title"><?php the_title_attribute(); ?></div>
- <p class="smalljobtitle"><?php the_field('job_title'); ?><?php echo $label; ?></p>
- </div>
- </a>
- </li>
- <?php endwhile; ?>
- <?php endif; ?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment