crfboston

Getting the same panel description

Jun 16th, 2022
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.40 KB | None | 0 0
  1. <?php
  2.                 $args = array('pagename' => 'agenda');
  3.                 $agenda_page = new WP_Query($args);
  4.  
  5.                 if($agenda_page->have_posts()) : while($agenda_page->have_posts()) : $agenda_page->the_post();
  6.                     ?>
  7.  
  8.             <section class="content">
  9.  
  10.  
  11.             <h3><?php the_field('agenda_list_title'); ?></h3>
  12.             <?php the_field('agenda_list_intro_paragraph'); ?>
  13.  
  14.                         <?php the_content(); ?>
  15.  
  16.                         <?php endwhile; endif; ?>
  17.  
  18.  
  19.  
  20.                  <ul class="event-list">
  21.                     <?php
  22.                             $agenda_posts = new WP_Query(array('post_type' => 'agenda', 'orderby' => 'post_date', 'order' => 'ASC'));
  23.                             while ($agenda_posts->have_posts()) : $agenda_posts->the_post();
  24.  
  25.                                 if( get_field('2021_agenda')) {
  26.                         ?>
  27.  
  28.                             <li class="event" id="agendastart">
  29.                                 <div class="event-time">
  30.  
  31.                                     <?php
  32.                                     if (have_rows('time_begin')):
  33.                                     while (have_rows('time_begin')) : the_row();
  34.  
  35.                                     $time = get_sub_field('time');
  36.                                     $time = ltrim($time, '0');
  37.                                     echo $time;
  38.                                     the_sub_field('am/pm');
  39.  
  40.                                     endwhile;
  41.                                     endif;
  42.  
  43.                                     echo ' ' . __('&ndash;') . ' ';
  44.  
  45.                                     if (have_rows('time_end')):
  46.                                     while (have_rows('time_end')) : the_row();
  47.  
  48.                                     $time = get_sub_field('time');
  49.                                     $time = ltrim($time, '0');
  50.                                     echo $time;
  51.                                     the_sub_field('am/pm');
  52.  
  53.                                     endwhile;
  54.                                     endif;
  55.                                     ?>
  56.                                 </div>
  57.  
  58.                                 <?php edit_post_link('[Edit Event]', '<div class="edit-link">', '</div>'); ?>
  59.                                 <div class="indent">
  60.  
  61.                                     <?php
  62.  
  63.                                     $c = 0;
  64.                                     if (have_rows('talks')):
  65.                                     while (have_rows('talks')) : the_row();
  66.  
  67.                                     $title = get_sub_field('title');
  68.                                     $subtitle = get_sub_field('subtitle');
  69.                                     ?>
  70.  
  71.                                     <div class="pretitle"><?=$title;?></div>
  72.  
  73.                                     <?php if ($subtitle) : ?>
  74.  
  75.                                         <div class="event-title">
  76.                                             <?php $content = get_sub_field('description'); if ($content) : ?>
  77.  
  78.                                                 <a class='iframe' href="<?php the_permalink(); ?>">
  79.                                                   <?php echo $subtitle; ?></a>
  80.                                             <?php else: ?>
  81.                                                 <?php echo $subtitle; ?>
  82.                                             <?php endif; ?>
  83.                                         </div>
  84.  
  85.                                     <?php endif; ?>
  86.  
  87.                                     <ul class="speaker-list">
  88.  
  89.  
  90.                                         <?php
  91.                                         $speakers = get_sub_field('speakers');
  92.  
  93.                                         if ($speakers) :
  94.                                             foreach ($speakers as $speaker) :
  95.  
  96.                                             $label = '';
  97.                                             $mod = get_field('moderator', $speaker->ID);
  98.                                             $intr = get_field('intro_speaker', $speaker->ID);
  99.  
  100.                                             if ($mod == true) :
  101.                                                 $label = ' <span style="color:' . get_field('primary_branding_color', 'options') . '">(moderator)</span>';
  102.                                             endif;
  103.  
  104.                                             if ($intr == true) :
  105.                                                 $label = ' <span style="color: #35a6c4">(introduction)</span>';
  106.                                             endif;
  107.  
  108.                                             ?>
  109. <li>
  110.  
  111. <a class='iframe' href="<?php echo get_permalink($speaker->ID); ?>"><?php echo get_the_title($speaker->ID); ?></a><?php echo $label; ?>
  112.  
  113.     <?php the_field('job_title', $speaker->ID); ?>
  114. </li>
  115.  
  116.                                             <?php
  117.                                             endforeach;
  118.                                         endif; ?>
  119. </ul>
  120.  
  121.                                     <?php
  122.                                         $c++;
  123.                                     endwhile;
  124.                                     endif;
  125.                                     ?>
  126.  
  127.                                 </div>
  128.                             </li>
  129.  
  130.                             <?php } endwhile; ?>
  131.  
  132.                         </ul>
  133.  
  134.             </section>
Advertisement
Add Comment
Please, Sign In to add comment