Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing dev/github inconsistency
  • Loading branch information
jmr06005 committed Dec 10, 2015
1 parent 9e40917 commit f8d485a
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 244 deletions.
124 changes: 66 additions & 58 deletions inc/person-no-about.php
@@ -1,58 +1,66 @@
<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>
<p class="text-muted"><?php the_field('title'); ?></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 {
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 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>': '' );
}
?>
<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 == '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('file');
displayField('mailing_address');
displayField('office_location');
displayField('office_hours');
displayField('courses');
?>
</table>
</div>
130 changes: 69 additions & 61 deletions inc/person-with-about.php
@@ -1,62 +1,70 @@
<div class="col-sm-8">
<h1>
<?php
the_field('first_name');
echo ' ';
if (get_field('middle_name')){
the_field('middle_name');
echo ' ';
};
the_field('field_last_name');
?></h1>
<p class="text-muted"><?php the_field('title'); ?></p>
<hr/>
<?php the_field('about'); ?>
</div>
<div class="col-sm-4">
<?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 class="col-sm-8">
<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>': '' );
}
?>
<hr/>
<?php the_field('about'); ?>
</div>
<div class="col-sm-4">
<?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 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('file');
displayField('mailing_address');
displayField('office_location');
displayField('office_hours');
displayField('courses');
?>
</table>
</div>
</div>

0 comments on commit f8d485a

Please sign in to comment.