Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
6834ec5ce7
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
139 lines (125 sloc) 7.07 KB
<?php
/*
Template Name: Programs
*/
?>
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'programs',
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => -1
);
$posts = get_posts($args);
?>
<div id="page-sorting-programs">
<div class="sorting-degrees clearfix">
<div class="col-md-2">
<h2>Degrees</h2>
</div>
<div class="col-md-10">
<form>
<ul>
<li><input type="checkbox" class="degree-filter" name="masters" value="masters" id="masters"><label for="masters">Master's</label></li>
<li><input type="checkbox" class="degree-filter" name="doctoral" value="doctoral" id="doctoral"><label for="doctoral">Doctoral/PhD</label></li>
<li><input type="checkbox" class="degree-filter" name="certificate" value="certificate" id="certificate"><label for="certificate">Certificate</label></li>
<li><input type="checkbox" class="degree-filter" name="online" value="online" id="online"><label for="online">Online</label></li>
</ul>
</form>
</div>
</div>
<div class="sorting-areas-of-interest clearfix">
<div class="col-md-2">
<h2>Areas of Interest</h2>
</div>
<div class="col-md-10">
<form>
<ul>
<li><input type="checkbox" class="aoi-filter" name="agriculture" value="agriculture" id="agriculture"><label for="agriculture">Agriculture</label></li>
<li><input type="checkbox" class="aoi-filter" name="business" value="business" id="business"><label for="business">Business</label></li>
<li><input type="checkbox" class="aoi-filter" name="education" value="education" id="education"><label for="education">Education</label></li>
<li><input type="checkbox" class="aoi-filter" name="engineering" value="engineering" id="engineering"><label for="engineering">Engineering</label></li>
<li><input type="checkbox" class="aoi-filter" name="fine-arts" value="fine-arts" id="fine-arts"><label for="fine-arts">Fine Arts</label></li>
<li><input type="checkbox" class="aoi-filter" name="health" value="health" id="health"><label for="health">Health</label></li>
<li><input type="checkbox" class="aoi-filter" name="humanities" value="humanities" id="humanities"><label for="humanities">Humanities</label></li>
<li><input type="checkbox" class="aoi-filter" name="natural-sciences" value="natural-sciences" id="natural-sciences"><label for="natural-sciences">Natural Sciences</label></li>
<li><input type="checkbox" class="aoi-filter" name="social-sciences" value="social-sciences" id="social-sciences"><label for="social-sciences">Social Sciences</label></li>
</ul>
</form>
</div>
</div>
<section id="program-wrapper" class="program-content clearfix">
<div class="program-container">
<?php if(!empty($posts)): ?>
<ul class="program-grid">
<?php
foreach($posts as $post): setup_postdata($post);
$degrees = get_post_meta( get_the_ID(), 'degree_filter');
$aois = get_post_meta( get_the_ID(), 'areas_of_interest_filter');
?>
<div class="col-sm-3 <?php
if(isset($degrees[0])) echo implode(' ',$degrees[0]).' ';
if(isset($aois[0])) echo implode(' ',$aois[0]).' ';
?>">
<li class="program-box">
<div class="img-wrap">
<a href="<?php echo get_post_meta( get_the_ID(), 'program_url', true ); ?>">
<?php the_post_thumbnail('large');?>
</a>
</div>
<div class="program-name-wrap <?php echo 'color-'.get_post_meta( get_the_ID(), 'areas_of_interest_color', true ); ?>"> <!------------ (Josh it up) - Add a class name here so I can change the color of the box -------------->
<a class="program-name" href="<?php echo get_post_meta( get_the_ID(), 'program_url', true ); ?>">
<?php the_title(); ?>
</a>
</div>
<div class="details-wrap <?php echo 'color-'.get_post_meta( get_the_ID(), 'areas_of_interest_color', true ); ?>"> <!------------ (Josh it up) - Add the same class name from above so I can change the color of the box -------------->
<div class="department-website">
<a href="<?php echo get_post_meta( get_the_ID(), 'program_url', true ); ?>">Department Website</a>
</div>
<div class="concentrations">
<a data-toggle="modal" data-target="#concentrations<?php the_ID(); ?>">View Concentrations</a> <!------------ (Josh it up) - Opens modal -------------->
</div>
<div class="phone-number">
<p><?php echo get_post_meta( get_the_ID(), 'phone_number', true ); ?></p>
</div>
<p class="degrees">
<?php echo get_post_meta( get_the_ID(), 'degrees', true ); ?>
</p>
</div>
</li>
</div>
<?php endforeach;?>
</ul>
<?php else: ?>
<p>
<?php _e('Sorry, no programs exist.'); ?>
</p>
<?php endif; ?>
</div>
</section>
</div>
<?php if(!empty($posts)): ?>
<?php
foreach($posts as $post): setup_postdata($post); ?>
<div class="modal fade" id="concentrations<?php the_ID(); ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Concentrations</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<?php echo get_post_meta( get_the_ID(), 'concentrations', true ); ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php endforeach;?>
<?php endif; ?>
<?php get_footer(); ?>