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

Commit

Permalink
Merge pull request #39 from jmr06005/master
Browse files Browse the repository at this point in the history
Update to homepage template to fix weird column width issue
  • Loading branch information
amb00010 committed Oct 8, 2014
2 parents 1330281 + 51375a0 commit 8b1b9d9
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions page-home.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<?php
/**
Template Name: Home
* The template for displaying the homepage.
*
* @package cornerstone
*/
$rows = get_theme_mod('homepagerows');
$count = 1;
get_header(); ?>

<div id="page-home">
<?php while ( have_posts() ) : the_post(); ?>
<?php for($i=0; $i<$rows; $i++){ /* Begin Homepage Builder... */?>
<div class="row">
<?php
$widths = get_theme_mod('homepage_'.$i);
$widths = explode(',',$widths);
foreach($widths as $width){
if($width == 0) break;
?>
<div class="col-sm-<?php echo $width; ?>">
<div class="home-section" id="home-section-<?php echo $count; ?>">
<?php if ( is_active_sidebar( 'home'.$count ) ) { ?>
<?php dynamic_sidebar( 'home'.$count ); ?>
<?php } else { ?>
<?php }; ?>
</div>
</div>
<?php $count ++; } ?>
</div>
<!-- /row-->
<?php } /* ... end Homepage Builder */?>
<?php endwhile; // end of the loop. ?>
</div>
<?php get_footer(); ?>
<?php
/**
Template Name: Home
* The template for displaying the homepage.
*
* @package cornerstone
*/
$rows = get_theme_mod('homepagerows');
$count = 1;
get_header(); ?>

<div id="page-home">
<?php while ( have_posts() ) : the_post(); ?>
<?php for($i=0; $i<$rows; $i++){ /* Begin Homepage Builder... */?>
<div class="row">
<?php
$widths = get_theme_mod('homepage_'.$i);
$widths = explode(',',$widths);
if(count($widths) == 1) $widths[0] = 12;
foreach($widths as $width){
if($width == 0) break;
?>
<div class="col-sm-<?php echo $width; ?>">
<div class="home-section" id="home-section-<?php echo $count; ?>">
<?php if ( is_active_sidebar( 'home'.$count ) ) { ?>
<?php dynamic_sidebar( 'home'.$count ); ?>
<?php } else { ?>
<?php }; ?>
</div>
</div>
<?php $count ++; } ?>
</div>
<!-- /row-->
<?php } /* ... end Homepage Builder */?>
<?php endwhile; // end of the loop. ?>
</div>
<?php get_footer(); ?>

0 comments on commit 8b1b9d9

Please sign in to comment.