Skip to content

Commit

Permalink
Merging terriann/Foundation@c0eeb8065406c3cee27cc381bdef8bf5a9a072b8
Browse files Browse the repository at this point in the history
  • Loading branch information
dougjohnston committed Jan 9, 2014
2 parents 1b76b06 + c0eeb80 commit 59fc269
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
36 changes: 34 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,47 @@
<!-- Footer -->
<footer class="row">

<?php if ( dynamic_sidebar('Footer Column #1') || dynamic_sidebar('Footer Column #2') || dynamic_sidebar('Footer Column #3') || dynamic_sidebar('Footer Column #4') ) : else : ?>
<?php
$foundation_sidebars = array('foundation_footer_one','foundation_footer_two','foundation_footer_three','foundation_footer_four');
$count = 0;
/*
Check to see how many columns the footer is required to support
and unset inactive sidebars
*/
foreach($foundation_sidebars as $x=>$sidebar)
{
if(is_active_sidebar($sidebar)) {
$count++;
} else {
unset($foundation_sidebars[$x]);
}

}
/*
Display active sidebars with the approprite column width
The widgets in the sidebars stack in their column
*/
if($count){
$col_width = 12/$count;
foreach($foundation_sidebars as $sidebar)
{
?>
<div id="<?php echo $sidebar;?>" class="large-<?php echo $col_width;?> columns">
<?php dynamic_sidebar($sidebar); ?>
</div>
<?php
}

} else {
?>

<div class="large-12 columns">
<ul class="inline-list">
<?php wp_list_pages('title_li='); ?>
</ul>
</div>

<?php endif; ?>
<?php } ?>

</footer>
<!-- End Footer -->
Expand Down
16 changes: 8 additions & 8 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ function foundation_widgets() {
'id' => 'foundation_footer_one',
'name' => __( 'Footer Column #1', 'foundation' ),
'description' => __( 'Located in column one of the footer.', 'foundation' ),
'before_widget' => '<div class="large-3 columns">',
'after_widget' => '</div>',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5>',
'after_title' => '</h5>',
) );
Expand All @@ -232,8 +232,8 @@ function foundation_widgets() {
'id' => 'foundation_footer_two',
'name' => __( 'Footer Column #2', 'foundation' ),
'description' => __( 'Located in column two of the footer.', 'foundation' ),
'before_widget' => '<div class="large-3 columns">',
'after_widget' => '</div>',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5>',
'after_title' => '</h5>',
) );
Expand All @@ -243,8 +243,8 @@ function foundation_widgets() {
'id' => 'foundation_footer_three',
'name' => __( 'Footer Column #3', 'foundation' ),
'description' => __( 'Located in column three of the footer.', 'foundation' ),
'before_widget' => '<div class="large-3 columns">',
'after_widget' => '</div>',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5>',
'after_title' => '</h5>',
) );
Expand All @@ -254,8 +254,8 @@ function foundation_widgets() {
'id' => 'foundation_footer_four',
'name' => __( 'Footer Column #4', 'foundation' ),
'description' => __( 'Located in column four of the footer.', 'foundation' ),
'before_widget' => '<div class="large-3 columns">',
'after_widget' => '</div>',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5>',
'after_title' => '</h5>',
) );
Expand Down

0 comments on commit 59fc269

Please sign in to comment.