Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
65eb192b8b
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
96 lines (89 sloc) 2.64 KB
<div class="content-person row">
<div class="col-sm-3">
<?php if(get_the_post_thumbnail()){
echo '<div class="person-thumbnail">';
the_post_thumbnail();
echo '</div>';
};?>
<div>
<table class="table">
<legend class="sr-only">Contact Information</legend>
<?php
function displayField($field){
if (get_field($field)){
$field_key = 'field_'.$field;
$field_obj = get_field_object($field_key);
$field_value = $field_obj['value'];
$field_label = $field_obj['label'];
echo '<tr><th>'.$field_label.'</th>';
echo '<td class="person-'.$field.'">';
if ($field == 'email'){
echo '<a href="mailto:'.$field_value.'">';
the_field($field);
echo '</a>';
} else if ($field == 'file'){
$file = get_field($field);
$url= $file['url'];
echo '<a href="'.$url.'"><span class="glyphicon glyphicon-save-file"></span> ';
echo $file['title'];
echo '</a>';
} else {
the_field($field);
}
echo '</td></tr>';
}
}
displayField('email');
displayField('phone');
displayField('phone_(alternate)');
displayField('fax');
displayField('file');
displayField('mailing_address');
displayField('office_location');
displayField('office_hours');
displayField('courses');
?>
</table>
</div>
</div>
<div class="col-sm-9">
<h1><?php
the_field('first_name');
echo ' ';
if (get_field('middle_name')){
the_field('middle_name');
echo ' ';
};
the_field('field_last_name');
if (get_field('name_suffix')){
echo ', '.get_field('name_suffix');
}
?></h1>
<p class="text-muted"><?php the_field('title'); ?></p>
<?php the_field('about'); ?>
<p class="links">
<a href="<?php echo get_bloginfo('url') . '/contact' ?>" class="btn btn-success"><span class="glyphicon glyphicon-envelope"></span> Contact</a>
<a href="<?php if (get_field('faculty_website')){the_field('faculty_website');} ?>" class="btn btn-default"><span class="glyphicon glyphicon-link"></span> Department Page</a>
</p>
<?php
$specialties = get_the_terms($postID,'persontag');
if ($specialties){
$count = count($specialties);
$i=1;
echo '<hr/><p class="specialties">View More Experts: ';
foreach ($specialties as $specialty) {
//var_dump($specialty);
//echo "$topic->name";
//echo "$topic->slug";
$url = get_bloginfo('url');
echo '<a href="'.$url.'/persontag/'.$specialty->slug.'">'.$specialty->name.'</a>';
if ($count>1 && $i<$count){
echo ', ';
};
$i++;
}
echo '</p>';
}
?>
</div>
</div>