Support

Account

Home Forums ACF PRO Refresh Data on Page Reply To: Refresh Data on Page

  • Maybe something is up with my template for this page.

    <?php
    /**
     * Template Name: Schedule Page
     *
     */
    get_header();
    
    $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );
    
    ?>
    
    <div id="main-content">
    
    <?php if ( ! $is_page_builder_used ) : ?>
    
    	<div class="container">
    		<div id="content-area" class="clearfix">
    			<div id="left-area">
    
    <?php endif; ?>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    				<div class="entry-content">
                    <!-- START Schedules Content -->
    					<div class="et_pb_section  et_pb_section_0 et_section_regular">
    				
    				
    					
    					<div class=" et_pb_row et_pb_row_0">
    				
    				<div class="et_pb_column et_pb_column_4_4 et_pb_column_0">
    				<div id="SchedulePageTopContainer">
    				<div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left  et_pb_text_0">
    				<?php $image = wp_get_attachment_image_src(get_field('side_image'), 'full'); ?>
    <!-- START Page Image -->
    <div class="ScheduleLeft"><img class="size-full ScheduleImage" src="<?php echo $image[0]; ?>" alt="<?php echo get_the_title(get_field('side_image')) ?>" /></div>
    <!-- END Page Image -->
    
    <div class="ScheduleRight">
    <!-- START Page Title -->
    <?php
    if(get_field('page_title'))
    {
    	echo '<h1 class="ScheduleHeadline">' . get_field('page_title') . '</h1>';
    }
    ?>
    <!-- END Page Title -->
    <!-- START Day Hours -->
    <?php
    if(get_field('day_hours'))
    {
    	echo '<p class="ScheduleHours"><img class="alignleft size-full wp-image-159 ScheduleIcon" src="http://camelotshowbar.com/wp-content/uploads/2015/09/DayKeyIcon1.png" alt="DayKeyIcon" width="170" height="50" />' . get_field('day_hours') . '</p>';
    }
    ?>
    <!-- END Day Hours -->
    <!-- START Night Hours -->
    <?php
    if(get_field('night_hours'))
    {
    	echo '<p class="ScheduleHours"><img class="alignleft size-full wp-image-159 ScheduleIcon" src="http://camelotshowbar.com/wp-content/uploads/2015/09/NightKeyIcon1.png" alt="DayKeyIcon" width="170" height="50" />' . get_field('night_hours') . '</p>';
    }
    ?>
    <!-- END Day Hours -->
    <!-- START Page Title -->
    <?php
    if(get_field('weekly_shoutout'))
    {
    	echo '<h2 class="ScheduleShout">' . get_field('weekly_shoutout') . '</h2>';
    }
    ?>
    <!-- END Page Title -->
    </div>
    
    			</div> <!-- .et_pb_text -->
    </div><!-- /SchedulePageTopContainer -->
    <div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left  et_pb_text_1">
    				
    <div id="ScheduleHeader">
    <table id="TableHeader">
    <tbody>
    <tr>
    	<td class="column-1">&nbsp;</td><td class="column-2"><span class="Mon"></span></td><td class="column-3"><span class="Tue"></span></td><td class="column-4"><span class="Wed"></span></td><td class="column-5"><span class="Thu"></span></td><td class="column-6"><span class="Fri"></span></td><td class="column-7"><span class="Sat"></span></td><td class="column-8"><span class="Sun"></span></td>
    </tr>
    </tbody>
    </table>
    </div><!-- /ScheduleHeader -->
    
    <div id="Schedule">
    <?php 
    
    // get repeater field data
    $repeater = get_field('employee_schedule');
    
    // vars
    $order = array();
    
    // populate order
    foreach( $repeater as $i => $row ) {
    	
    	$order[ $i ] = $row['name'];
    	
    }
    // multisort
    array_multisort( $order, SORT_ASC, $repeater );
    
    // loop through repeater
    if( $repeater ): ?>
    
    	<table id="ScheduleTable">
    
    	<?php foreach( $repeater as $i => $row ): ?>
    
    		<tr>
            <td class="column-1"><?php echo $row['name']; ?></td>
            <!-- START MONDAY -->
            <td class="column-2">
    		<?php $field = $row['monday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
    
    		</td>
            <!-- END MONDAY -->
            <!-- ------------------------ -->
            <!-- START TUESDAY -->
            <td class="column-3"><?php $field = $row['tuesday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END TUESDAY -->
            <!-- ------------------------ -->
            <!-- START WEDNESDAY -->
               <td class="column-4"><?php $field = $row['wednesday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END WEDNESDAY -->
            <!-- ------------------------ -->
            <!-- START THURSDAY -->   
            <td class="column-5"><?php $field = $row['thursday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END THURSDAY -->
            <!-- ------------------------ -->
            <!-- START FRIDAY -->
            <td class="column-6"><?php $field = $row['friday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END FRIDAY -->
            <!-- ------------------------ -->
            <!-- START SATURDAY -->
            <td class="column-7"><?php $field = $row['saturday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END SATURDAY -->
            <!-- ------------------------ -->
            <!-- START SUNDAY -->
            <td class="column-8"><?php $field = $row['sunday']; ?>
            <?php if( in_array('Day', $field) && in_array('Night', $field)) {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/DayNight.png"; 
    			$ImageIconAlt ="Day and Night"; 
    		} elseif (in_array('Day', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Day.png"; 
    			$ImageIconAlt ="Day"; 
    		} elseif (in_array('Night', $field)){
    			$ImageIcon ="/wp-content/themes/Divi-child/images/Night.png"; 
    			$ImageIconAlt ="Night"; 
    		} else {
    			$ImageIcon ="/wp-content/themes/Divi-child/images/spacer.gif"; 
    			$ImageIconAlt ="Off";
    		}
    		?>
    			
               <img src="<?php echo $ImageIcon; ?>" class="DayNightCircle" alt="<?php echo $ImageIconAlt; ?>"/>
               </td>
            <!-- END SUNDAY -->
    
            </tr>
    
    	<?php endforeach; ?>
    
    	</table>
    
    <?php endif; ?>
    </div>
    
    			</div> <!-- .et_pb_text -->
    			</div> <!-- .et_pb_column -->
    					
    			</div> <!-- .et_pb_row -->
    				
    			</div> <!-- .et_pb_section -->
    					</div> <!-- .entry-content -->
    
    				</article> <!-- .et_pb_post -->
    
    			<?php endwhile; ?>
    
    <?php if ( ! $is_page_builder_used ) : ?>
    
    			</div> <!-- #left-area -->
    
    			<?php get_sidebar(); ?>
    		</div> <!-- #content-area -->
    	</div> <!-- .container -->
    
    <?php endif; ?>
    
    </div> <!-- #main-content -->
    
    <?php get_footer(); ?>