This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
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?
uc-abroad/templates/page-programs.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
215 lines (205 sloc)
6.17 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Programs New | |
*/ | |
?> | |
<?php get_header(); ?> | |
<div class="holdit"> | |
<!-- =========== Selection Menu ============ --> | |
<?php | |
$programTabIDs = array( | |
get_page_by_title('Uconn In')->ID => 'UConn Faculty-Led', | |
get_page_by_title('Exchange Programs')->ID => 'Exchange', | |
get_page_by_title('CT - BW Exchange')->ID => 'CT - BW Exchange', | |
get_page_by_title('3rd Party / Direct Enroll')->ID => '3rd Party/Direct Enroll', | |
get_page_by_title('Open to Non-UConn Students')->ID => 'Open to Non-UConn Students', | |
get_page_by_title('PROGRAMS')->ID => 'All Programs' | |
); | |
?> | |
<section id="program-container" class="container program-content"> | |
<!-- Student Prospective Menu ---> | |
<div class="row-fluid"> | |
<div class="span10 filterbuttons"> | |
<!-- Filter Buttons ---> | |
<div class="btn-group pull-left filter1"> | |
<ul class="btn-group"> | |
<?php | |
foreach( $programTabIDs as $id => $title ){ | |
echo '<li class="btn'.(is_page($id) ? ' active': '' ).'"><a href="'.get_permalink($id).'">'.$title.'</a></li>'; | |
} | |
?> | |
</ul> | |
<?php | |
/*switch($currentPageID){ | |
case $programID: | |
$cat = 'study-program'; | |
break; | |
case $exchangeID: | |
$cat = 'exchange-partner'; | |
break; | |
case $uconnInID: | |
$cat = 'uconn-faculty-led'; | |
break; | |
case $thirdPartyID: | |
$cat = 5; | |
break; | |
case $nonUconn: | |
$cat = 513; | |
break; | |
}*/ | |
include('sorting-list.php'); //Moved the dropdowns to sorting-list.php | |
?> | |
!!!!!!!!!!!!!!!!!!!</div> | |
</div> | |
</div> | |
</div> | |
</section> | |
<hr> | |
<!-- =========== Programs Content Columns ============ --> | |
<?php | |
$currentTerm = 'study-program'; | |
?> | |
<?php | |
/*$currentTerm comes from the page template it was included from: | |
page-programs, page-pexchange, page-puconnin, page-party, page-ptemporary | |
*/ | |
?> | |
<section class="container"> | |
<div class="tab-content"> | |
<!-- Grid Start --> | |
<div class="tab-pane active" id="tab1"> | |
<div class="program-container"> | |
<ul class="program-grid"> | |
<?php | |
$args = array( | |
'post_type' => 'program', | |
'orderby' => 'title', | |
'order' => 'ASC', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'category', | |
'field' => 'slug', | |
'terms' => $currentTerm | |
)), | |
'posts_per_page' => -1 | |
//'posts_per_page' => $num, incorrect way to get shows | |
); | |
$posts = get_posts($args); | |
?> | |
<?php | |
if(!empty($posts)): foreach($posts as $post): setup_postdata($post); ?> | |
<?php | |
$tags = get_the_tags(); | |
$search = array(" ", "/"); | |
$replace = array("", "-");?> | |
<li class="program-box<?php | |
if($tags){ | |
$add_all_countries_tag = false; | |
$add_all_regions_tag = false; | |
$add_all_cities_tag = false; | |
$add_all_terms_tag = false; | |
foreach($tags as $tag) { | |
if(!$add_all_countries_tag && in_array($tag->name,$countries)) { | |
$add_all_countries_tag = true; | |
$tempTag = new stdClass(); | |
$tempTag->name = 'allcountries'; | |
array_push($tags, $tempTag); | |
} | |
if(!$add_all_regions_tag && in_array($tag->name,$regions)) { | |
$add_all_regions_tag = true; | |
$tempTag = new stdClass(); | |
$tempTag->name = 'allregions'; | |
array_push($tags, $tempTag); | |
} | |
if(!$add_all_cities_tag && in_array($tag->name,$cities)) { | |
$add_all_cities_tag = true; | |
$tempTag = new stdClass(); | |
$tempTag->name = 'allcities'; | |
array_push($tags, $tempTag); | |
} | |
if(!$add_all_terms_tag && in_array($tag->name,$terms)) { | |
$add_all_terms_tag = true; | |
$tempTag = new stdClass(); | |
$tempTag->name = 'allterms'; | |
array_push($tags, $tempTag); | |
} | |
} | |
foreach($tags as $tag){ | |
echo ' '.strtolower(str_replace($search, $replace, $tag->name)); | |
} | |
} | |
?>"> <a href="<?php the_permalink() ?>"> | |
<?php the_post_thumbnail();?> | |
<span class="program-name"> | |
<?php the_title(); ?> | |
</span> </a> </li> | |
<?php endforeach;?> | |
<?php else: ?> | |
<p> | |
<?php _e('Sorry, no exchange programs are listed.'); ?> | |
</p> | |
<?php endif; ?> | |
</ul> | |
</div> | |
</div> | |
<!-- Grid End --> | |
<!-- List Start --> | |
<div class="tab-pane" id="tab2"> | |
<ol class="program-list-view" > | |
<?php | |
$args = array( | |
'post_type' => 'program', | |
'orderby' => 'title', | |
'order' => 'ASC', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'category', | |
'field' => 'slug', | |
'terms' => $currentTerm | |
)), | |
'posts_per_page' => -1 | |
//'posts_per_page' => $num, incorrect way to get shows | |
); | |
$posts = get_posts($args); | |
//var_dump($posts); | |
?> | |
<?php if(!empty($posts)): foreach($posts as $post): setup_postdata($post); ?> | |
<?php $tags = get_the_tags(); | |
$search = array(" ", "/"); | |
$replace = array("", "-");?> | |
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>"> | |
<ul id="badge-list" class"program-info"> | |
<a href="<?php the_permalink() ?>"> | |
<li class="list-img"> | |
<?php the_post_thumbnail();?> | |
</li> | |
<li class="list-title"> | |
<?php the_title(); ?> | |
</li> | |
<li class="list-city"> | |
</li> | |
<li class="list-country"> | |
<?php $key="program-country"; echo get_post_meta($post->ID, $key, true); ?> | |
</li> | |
<li class="list-region"> | |
<?php $key="program-region"; echo get_post_meta($post->ID, $key, true); ?> | |
</li> | |
<li class="list-semester"> | |
<?php $key="program-semester"; echo get_post_meta($post->ID, $key, true); ?> | |
</li> | |
</a> | |
</ul> | |
</li> | |
<?php endforeach?> | |
<?php else: ?> | |
<p> | |
<?php _e('Sorry, no exchange programs are listed.'); ?> | |
</p> | |
<?php endif; ?> | |
</ol> | |
</div> | |
<!-- List End --> | |
</div> | |
</section> | |
</div> | |
<?php get_footer(); ?> |