Skip to content

Commit

Permalink
Manual Merge
Browse files Browse the repository at this point in the history
Getting Salman's and Joshs changes into place
  • Loading branch information
andrewmbacon committed Aug 12, 2014
1 parent 02f8de1 commit d7df22b
Show file tree
Hide file tree
Showing 5 changed files with 452 additions and 392 deletions.
22 changes: 22 additions & 0 deletions css/widgets-area.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
$absolute_path = explode('wp-content', $_SERVER['SCRIPT_FILENAME']);
$wp_load = $absolute_path[0] . 'wp-load.php';
require_once($wp_load);

header("Content-type: text/css; charset: UTF-8");
header('Cache-control: must-revalidate');

$sidebars = wp_get_sidebars_widgets();
$index = 0;
for ($i=1; $i < 31 ; $i++) {
if( !empty($sidebars['home'.$i]) ){
if( $i > $index ){
$index = $i; //$index is the biggest home widget area that has widgets, the next widget area doesn't have widgets
}
}
}
$start = ++$index;
for ($i=$start; $i < 31; $i++) {
echo '#home'.$i.'{ display:none; } ';
}
?>
Loading

0 comments on commit d7df22b

Please sign in to comment.