Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Main content columns no longer dependent on existence of sidebar #445

Merged
merged 5 commits into from
Sep 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
get_header(); ?>

<div class="row">
<div class="small-12 large-8 columns" role="main">
<?php get_template_part( 'parts/check-if-sidebar-exist' ); ?>

<?php if ( have_posts() ) : ?>

Expand Down Expand Up @@ -48,4 +48,4 @@
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
<?php get_footer(); ?>
3 changes: 1 addition & 2 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<?php get_template_part( 'parts/featured-image' ); ?>

<div class="row">
<div class="small-12 large-8 columns" role="main">

<?php get_template_part( 'parts/check-if-sidebar-exist' ); ?>
<?php do_action( 'foundationpress_before_content' ); ?>

<?php while ( have_posts() ) : the_post(); ?>
Expand Down
9 changes: 9 additions & 0 deletions parts/check-if-sidebar-exist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
// Display a suitable column layout depending on whether sidebar exists
if ( is_active_sidebar( 'sidebar-widgets' ) ) :
echo '<div class="small-12 large-8 columns" role="main">';

else :
echo '<div class="small-12 columns" role="main">';
endif;
?>
3 changes: 1 addition & 2 deletions templates/front.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
</header>

<div class="row">
<div class="small-12 large-8 columns" role="main">

<?php get_template_part( 'parts/check-if-sidebar-exist' ); ?>
<?php do_action( 'foundationpress_before_content' ); ?>

<?php while ( have_posts() ) : the_post(); ?>
Expand Down