-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
42 lines (37 loc) · 1.31 KB
/
functions.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
function bigpicture_random_featured($type = null, $num = 5, $hasImage = true)
{
$html = '';
$featured = get_records($type, array('featured' => 1,
'sort_field' => 'random',
'hasImage' => $hasImage), $num
);
$html = '';
foreach ($featured as $featuredRecord) {
$type = strtolower($type);
if ($type !== 'exhibit') {
$path = $type . 's/featured.php';
} else {
$path = 'exhibit-builder/exhibits/featured.php';
}
$html .= get_view()->partial($path, array($type => $featuredRecord));
release_object($item);
}
return $html;
}
function bigpicture_featured_html() {
$html = '';
if ((get_theme_option('Display Featured Item') !== '0') && (get_random_featured_items())) {
$html .= bigpicture_random_featured('Item');
}
if ((get_theme_option('Display Featured Collection') !== '0') && (get_random_featured_collection())) {
$html .= bigpicture_random_featured('Collection');
}
if ((get_theme_option('Display Featured Exhibit') !== '0')
&& plugin_is_active('ExhibitBuilder')
&& function_exists('exhibit_builder_display_random_featured_exhibit')) {
$html .= bigpicture_random_featured('Exhibit');
}
return $html;
}
?>