Skip to content
Permalink
a88292317b
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
82 lines (81 sloc) 2.34 KB
<div class="col-sm-2 col-sm-offset-2">
<?php if(get_the_post_thumbnail()){
echo '<div class="person-thumbnail">';
the_post_thumbnail();
echo '</div>';
};?>
</div>
<div class="col-sm-6">
<h1>
<?php
the_field('first_name');
echo ' ';
if (get_field('middle_name')){
the_field('middle_name');
echo ' ';
};
the_field('field_last_name');
?></h1>
<?php
$titlePieces = explode(";", get_field('title'));
foreach( $titlePieces as $t ){
echo ( !empty($t) ? '<p class="text-muted">'.$t.'</p>': '' );
}
$departmentPieces = explode(";", get_field('department'));
foreach( $departmentPieces as $d ){
echo ( !empty($d) ? '<p class="text-muted">'.$d.'</p>': '' );
}
?>
<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 if ($field == 'url'){
echo '<a href="'.get_field($field).'">'.get_field($field).'</a>';
} else if ($field == 'mailing_address'){
echo str_replace(';','<br>',get_field('mailing_address'));
} else {
the_field($field);
}
echo '</td></tr>';
}
}
displayField('email');
displayField('phone');
displayField('phone_(alternate)');
displayField('fax');
displayField('mailing_address');
displayField('office_location');
displayField('campus');
displayField('office_hours');
displayField('courses');
displayField('url');
?>
</table>
<?php
if (get_field('file')){
$file = get_field('file');
$url= $file['url'];
echo '<a class="person-cv btn btn-default" href="'.$url.'"><span class="glyphicon glyphicon-save-file"></span>';
echo 'Download CV';
echo '</a>';
}
?>
</div>