content-course.php 3.64 KB
<?php
/**
 * Partial template for content in page.php
 *
 * @package Understrap
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$program_info = get_field('program_info'); 
?>

<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

	<div class="entry-content">
		<div class="row align-items-start">
			<div class="col-lg-6 ">
				<?php
				the_content();
				?>
			</div>
			<div class="col-lg-6 ">
				<div class="program-info">	
					<ul class="nav nav-tabs" id="program-info" role="tablist">
						<li class="nav-item" role="presentation">
							<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#who" type="button" role="tab" aria-controls="who" aria-selected="true">Who is this for?</button>
						</li>
						<li class="nav-item" role="presentation">
							<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#costs" type="button" role="tab" aria-controls="costs" aria-selected="false">Cost & Date(s)</button>
						</li>
					</ul>
						<div class="tab-content" id="program-info-content">
							<div class="tab-pane fade show active" id="who" role="tabpanel" aria-labelledby="who-tab" tabindex="0">
								<?php echo $program_info['who_is_this_for']; ?>
							</div>
							<div class="tab-pane fade" id="costs" role="tabpanel" aria-labelledby="costs-tab" tabindex="0">
								<?php if(is_array($program_info['cost_&_dates'])): ?>
									<table>
									<tr class="not"><th>Cost</th><th>Duration</th><th>Date</th></tr>
									<tr><td>PUBLIC&nbsp;&nbsp;|&nbsp;&nbsp;STAFF</td><td></td><td></td></tr>
									<?php foreach ( $program_info['cost_&_dates'] as $cost_dates){
											echo "<tr><td>$".trim($cost_dates['cost'])."&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;$".trim($cost_dates['cost_staff'])."</td><td>".$cost_dates['duration']."</td><td>".$cost_dates['date']."</td></tr>";
									};?>
									</table>
								<?php endif; ?>
								
							</div>
						</div>	
					</div>
				</div>
		</div>
		<?php if( have_rows('outcomes') ): ?>
			<div class="outcomes">	
				<h2>Outcomes</h2>
				<p>By the end of this workshop, participants will be able to:<p>
				<div class="row">
					<?php while( the_repeater_field('outcomes') ): ?>
						<div class="col-out col-lg-3">
						<?php if(get_sub_field('content') != ""){ ?>
							<div class="outcome">	
								<?php the_sub_field('content'); ?>
							</div>	
						<?php } ?>
						</div>							
					<?php endwhile; ?>
				</div>
			</div>
	    <?php endif; ?>
		<?php if( have_rows('testimonials_items') ): ?>
			<div id="<?php echo esc_attr($id); ?>" class="carousel">
				<div class="testimonials-carousel carousel-items <?php echo $size; ?>">
					<div class='swiper-wrapper'>
						<?php while( the_repeater_field('testimonials_items') ): ?>
								<div class="swiper-slide">
									<div id="<?php echo esc_attr($id); ?>" class=" testimonials">
											<?php $image = get_sub_field('image'); ?>
											<div class="row">
												<div class="col-md-4 testimonial-image" style=background-image:url(<?php echo $image['url'];?>); ></div>
												<div class="col-md-8">
													<div class="testimonial-text"><p><?php the_sub_field('text'); ?></p></div>
												</div>
											</div>
									</div>
								</div>
						<?php endwhile; ?>
					</div>
				<div class="swiper-pagination"></div>
				<div class="swiper-button-prev" data-id="<?= $id ?>"></div>
				<div class="swiper-button-next" data-id="<?= $id ?>"></div>
			</div>
		</div>
	<?php endif; ?>
	</div><!-- .entry-content -->

	<footer class="entry-footer">

		<?php understrap_edit_post_link(); ?>

	</footer><!-- .entry-footer -->

</article><!-- #post-<?php the_ID(); ?> -->