Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Aug 22, 2014
1 parent 7b12a69 commit 03c4b2e
Showing 1 changed file with 22 additions and 0 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; } ';
}
?>

0 comments on commit 03c4b2e

Please sign in to comment.