-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar-top.php
42 lines (42 loc) · 1.02 KB
/
sidebar-top.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
global $theme_sidebars;
$places = array();
foreach ($theme_sidebars as $sidebar){
if ($sidebar['group'] !== 'top')
continue;
$widgets = theme_get_dynamic_sidebar_data($sidebar['id']);
if (!is_array($widgets) || count($widgets) < 1)
continue;
$places[$sidebar['id']] = $widgets;
}
$place_count = count($places);
$needLayout = ($place_count > 1);
if ($place_count > 0) {
if ($needLayout) {
?>
<div class="art-content-layout">
<div class="art-content-layout-row">
<?php
}
foreach ($places as $widgets) {
if ($needLayout) {
?>
<div class="art-layout-cell art-layout-cell-size<?php echo $place_count; ?>">
<?php
}
foreach ($widgets as $widget) {
theme_print_widget($widget);
}
if ($needLayout) {
?>
</div>
<?php
}
}
if ($needLayout) {
?>
</div>
</div>
<?php
}
}