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

Add Persons Per Row Dropdown, allow 2,3,4 or 6 per row #138

Merged
merged 1 commit into from Apr 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions inc/people-grid.php
Expand Up @@ -4,6 +4,8 @@ if ( $the_query->have_posts() ) { ?>
<div class="row">
<?php
$person_count=1;
$persons_per_row = get_field("persons_per_row"); // default is 4

while ( $the_query->have_posts() ) {
$the_query->the_post();

Expand All @@ -12,11 +14,7 @@ if ( $the_query->have_posts() ) { ?>







<div class="col-sm-3 personcount-<?php echo $person_count ?>" id="person-<?php echo get_the_id(); ?>">
<div class="col-sm-<?php echo 12/$persons_per_row; ?> personcount-<?php echo $person_count ?>" id="person-<?php echo get_the_id(); ?>">
<div class="person">
<?php
$external_url = get_field('external_url');
Expand Down Expand Up @@ -132,7 +130,7 @@ if ( $the_query->have_posts() ) { ?>

<?php
// check to see if we need to close this row...
if ($person_count % 4 == 0){
if ($person_count % $persons_per_row == 0){
// if this is the 4th, 8th, 16th, etc person...
echo '</div><!-- /row --><div class="row">';
}
Expand Down