This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to homepage template to fix weird column width issue
- Loading branch information
Showing
1 changed file
with
38 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); ?> |