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
Merge pull request #138 from jjc16105/master
Add Persons Per Row Dropdown, allow 2,3,4 or 6 per row
  • Loading branch information
jmr06005 committed Apr 19, 2016
2 parents 8a22990 + 2b4926d commit 10dbd90
Showing 1 changed file with 4 additions and 6 deletions.
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

0 comments on commit 10dbd90

Please sign in to comment.