Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
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
<?php
/*
Template Name: Faculty and Staff List
*/
get_header();
function cmp($a, $b) {
return strcasecmp($a->sort,$b->sort);
}
?>
<div class="row">
<?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&order=asc'); } ?>
<div class="span8 floatleft">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post content clearfix" id="post-<?php the_ID(); ?>">
<!-- <h1 class="mediaMobileHeader">
<?php the_title(); ?>
</h1> -->
<div class="entry facultyPage">
<h4>Core Faculty</h4>
<?php
$archive_pages_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-profile-faculty.php'
);
$archive_pages = get_pages( $archive_pages_args );
foreach ( $archive_pages as $key=>$archive_page ) {
$page_id = $archive_page->ID;
$sort = get_post_meta($page_id, 'Faculty-Last-Name-Sort', true);
$archive_pages[$key]->sort = $sort;
}
usort($archive_pages,"cmp");
?>
<ul>
<?php
foreach ( $archive_pages as $archive_page ) {
$page_id = $archive_page->ID;
$contact = get_post_meta($page_id, 'Faculty-Contact', true);
$hours = get_post_meta($page_id, 'Faculty-Office-Hours', true);
$addr = get_post_meta($page_id, 'Faculty-Mailing-Address', true);
$location = get_post_meta($page_id, 'Faculty-Office-Location', true);
$title = get_post_meta($page_id, 'Faculty-Title', true);
echo '<li><a href="' . get_permalink( $archive_page->ID ) . '">';
$profile_image = wp_get_attachment_image_src( get_post_thumbnail_id( $page_id ) );
$src = $profile_image[0];
echo '<img src="'.$src.'"/>' . $archive_page->post_title . '';
echo '<br /><span class="faculty-title-list">'.$title.'</span>';
echo '<span class="profile-field" id="contact">'.$contact.'</span>';
echo '</a></li>';
}
?>
</ul>
<div class="clear"></div>
<h4>Affiliated Faculty</h4>
<?php
$archive_pages_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-profile-affiliated-faculty.php',
);
$archive_pages = get_pages( $archive_pages_args );
foreach ( $archive_pages as $key=>$archive_page ) {
$page_id = $archive_page->ID;
$sort = get_post_meta($page_id, 'Faculty-Last-Name-Sort', true);
$archive_pages[$key]->sort = $sort;
}
usort($archive_pages,"cmp");
?>
<ul>
<?php
foreach ( $archive_pages as $archive_page ) {
$page_id = $archive_page->ID;
$contact = get_post_meta($page_id, 'Faculty-Contact', true);
$hours = get_post_meta($page_id, 'Faculty-Office-Hours', true);
$addr = get_post_meta($page_id, 'Faculty-Mailing-Address', true);
$location = get_post_meta($page_id, 'Faculty-Office-Location', true);
$title = get_post_meta($page_id, 'Faculty-Title', true);
echo '<li><a href="' . get_permalink( $archive_page->ID ) . '">';
$profile_image = wp_get_attachment_image_src( get_post_thumbnail_id( $page_id ) );
$src = $profile_image[0];
echo '<img src="'.$src.'"/>' . $archive_page->post_title . '';
echo '<br /><span class="faculty-title-list">'.$title.'</span>';
echo '<span class="profile-field" id="contact">'.$contact.'</span>';
echo '</a></li>';
}
?>
</ul>
<div class="clear"></div>
<h4>Staff</h4>
<?php
$archive_pages_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-profile-staff.php',
);
$archive_pages = get_pages( $archive_pages_args );
foreach ( $archive_pages as $key=>$archive_page ) {
$page_id = $archive_page->ID;
$sort = get_post_meta($page_id, 'Faculty-Last-Name-Sort', true);
$archive_pages[$key]->sort = $sort;
}
usort($archive_pages,"cmp");
?>
<ul>
<?php
foreach ( $archive_pages as $archive_page ) {
$page_id = $archive_page->ID;
$contact = get_post_meta($page_id, 'Faculty-Contact', true);
$hours = get_post_meta($page_id, 'Faculty-Office-Hours', true);
$addr = get_post_meta($page_id, 'Faculty-Mailing-Address', true);
$location = get_post_meta($page_id, 'Faculty-Office-Location', true);
$title = get_post_meta($page_id, 'Faculty-Title', true);
echo '<li><a href="' . get_permalink( $archive_page->ID ) . '">';
$profile_image = wp_get_attachment_image_src( get_post_thumbnail_id( $page_id ) );
$src = $profile_image[0];
echo '<img src="'.$src.'"/>' . $archive_page->post_title . '';
echo '<br /><span class="faculty-title-list">'.$title.'</span>';
echo '<span class="profile-field" id="contact">'.$contact.'</span>';
echo '</a></li>';
}
?>
</ul>
<div class="clear"></div>
<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<div class="span3 floatleft">
<?php get_sidebar('Sidebar'); ?>
</div>
</div>
<?php get_footer(); ?>