This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
cornerstone/inc/people-grid.php
Go to file<?php | |
$the_query = new WP_Query( $args ); | |
if ( $the_query->have_posts() ) { ?> | |
<div class="row"> | |
<?php | |
$person_count=1; | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
?> | |
<div class="col-sm-3 personcount-<?php echo $person_count ?>" id="person-<?php echo get_the_id(); ?>"> | |
<div class="person"> | |
<?php | |
echo '<a href="'. get_the_permalink().'" class="person-permalink">'; | |
if (in_array('photo', $information_to_display)) { | |
echo '<div class="person-image">'; | |
the_post_thumbnail('large'); | |
echo '</div>'; | |
}; | |
if (in_array('first_name', $information_to_display) || in_array('middle_name', $information_to_display) || in_array('last_name', $information_to_display)){ | |
echo '<h4 class="person-name">'; | |
if (in_array('first_name', $information_to_display)) { | |
the_field('first_name'); | |
echo ' '; | |
}; | |
if (in_array('middle_name', $information_to_display)) { | |
the_field('middle_name'); | |
echo ' '; | |
}; | |
if (in_array('last_name', $information_to_display)) { | |
the_field('last_name'); | |
}; | |
echo '</h4>'; | |
}; | |
echo '</a>'; | |
if (in_array('title', $information_to_display)) { | |
echo '<p class="person-title">'; | |
$titlePieces = explode(";", get_field('title')); | |
foreach( $titlePieces as $t ){ | |
echo ( !empty($t) ? "<strong>{$t}</strong><br>": "" ); | |
} | |
echo '</p>'; | |
}; | |
if (in_array('about', $information_to_display)) { | |
echo '<div class="person-about">'; | |
the_field('about'); | |
echo '</div>'; | |
}; | |
if (in_array('file', $information_to_display)) { | |
$file = get_field('file'); | |
$urlLength = strlen($file['url']); | |
if ($urlLength > 0){ | |
echo '<p class="person-file">'; | |
echo '<a href="'.$file['url'].'">'.$file['title'].'</a>'; | |
echo '</p>'; | |
} | |
}; | |
if (in_array('email', $information_to_display)) { | |
echo '<p class="person-email">'; | |
echo '<a href="mailto:'.get_field('email').'">'.get_field('email').'</a>'; | |
echo '</p>'; | |
}; | |
if (in_array('phone', $information_to_display)) { | |
echo '<p class="person-phone">'; | |
the_field('phone'); | |
echo '</p>'; | |
}; | |
if (in_array('phone_(alternate)', $information_to_display)) { | |
echo '<p class="person-phone_(alternate)">'; | |
the_field('phone_(alternate)'); | |
echo '</p>'; | |
}; | |
if (in_array('fax', $information_to_display)) { | |
echo '<p class="person-fax">'; | |
the_field('fax'); | |
echo '</p>'; | |
}; | |
if (in_array('mailing_address', $information_to_display)) { | |
echo '<p class="person-mailing_address">'; | |
echo str_replace(';','<br>',get_field('mailing_address')); | |
echo '</p>'; | |
}; | |
if (in_array('office_location', $information_to_display)) { | |
echo '<p class="person-office_location">'; | |
the_field('office_location'); | |
echo '</p>'; | |
}; | |
if (in_array('office_hours', $information_to_display)) { | |
echo '<p class="person-office_hours">'; | |
the_field('office_hours'); | |
echo '</p>'; | |
}; | |
if (in_array('courses', $information_to_display)) { | |
echo '<p class="person-courses">'; | |
the_field('courses'); | |
echo '</p>'; | |
}; ?> | |
</div><!-- /person --> | |
</div> <!-- /col --> | |
<?php | |
// check to see if we need to close this row... | |
if ($person_count % 4 == 0){ | |
// if this is the 4th, 8th, 16th, etc person... | |
echo '</div><!-- /row --><div class="row">'; | |
} | |
$person_count++; | |
} //end of posts?> | |
</div><!-- last row --> | |
<?php | |
} else { | |
// no posts found | |
}; ?> | |