crfboston

Hide Reveal Gotchas

Jun 17th, 2022
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.74 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.                                     $description = get_sub_field('description');
  70.                                     ?>
  71.  
  72.                                     <div class="pretitle"><?=$title;?></div>
  73.  
  74.                                     <?php if ($subtitle) : ?>
  75.  
  76.                                         <div class="event-title">
  77.                                             <?php $content = get_sub_field('description'); if ($content) : ?>
  78.  
  79.                                                   <?php echo $subtitle; ?>
  80.                                                   <br><button onclick="myFunction()">More Details</button>
  81.                                         </div>
  82.  
  83.                                                  <div id="myDIV">
  84.                                                 <?php echo $description; ?>
  85.                                             <?php else: ?>
  86.                                                 <?php echo $subtitle; ?>
  87.                                             <?php endif; ?>
  88.                                                 </div>
  89.  
  90.                                     <?php endif; ?>
  91.  
  92.                                     <ul class="speaker-list">
  93.  
  94.  
  95.                                         <?php
  96.                                         $speakers = get_sub_field('speakers');
  97.  
  98.                                         if ($speakers) :
  99.                                             foreach ($speakers as $speaker) :
  100.  
  101.                                             $label = '';
  102.                                             $mod = get_field('moderator', $speaker->ID);
  103.                                             $intr = get_field('intro_speaker', $speaker->ID);
  104.  
  105.                                             if ($mod == true) :
  106.                                                 $label = ' <span style="color:' . get_field('primary_branding_color', 'options') . '">(moderator)</span>';
  107.                                             endif;
  108.  
  109.                                             if ($intr == true) :
  110.                                                 $label = ' <span style="color: #35a6c4">(introduction)</span>';
  111.                                             endif;
  112.  
  113.                                             ?>
  114.  
  115. <li>
  116.  
  117. <a class='iframe' href="<?php echo get_permalink($speaker->ID); ?>"><?php echo get_the_title($speaker->ID); ?></a><?php echo $label; ?>
  118.  
  119.     <?php the_field('job_title', $speaker->ID); ?>
  120. </li>
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                             <?php
  129.                                             endforeach;
  130.                                         endif; ?>
  131.  
  132.                                     </ul>
  133.  
  134.                                     <?php
  135.                                         $c++;
  136.                                     endwhile;
  137.                                     endif;
  138.                                     ?>
  139.  
  140.  
  141.                                 </div>
  142.                             </li>
  143.  
  144.                             <?php } endwhile; ?>
  145.  
  146.                         </ul>
  147.  
  148.             </section>
Advertisement
Add Comment
Please, Sign In to add comment