-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebarstuff.php
115 lines (89 loc) · 2.76 KB
/
sidebarstuff.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
function buddypress_page_layout() {
// What to do when only BP Sidebar is activated
if (get_theme_mod( 'buddypress-sidebars' ) == "sidebar2-on") {
?>
<style type="text/css">
body.buddypress .grid-container {
min-height: 100vh;
display: grid;
grid-template-columns: 100%;
grid-template-areas: "h"
"m"
"b"
"f";
}
@media (min-width: 768px) {
body.buddypress .grid-container {
grid-template-columns: 1fr 250px;
grid-template-rows: auto 1fr auto;
grid-template-areas: "h h"
"m b"
"f f";
}
}
</style>
<?php
}
// What to do when only Regular Sidebar is activated
if (get_theme_mod( 'buddypress-sidebars' ) == "sidebar1-on") {
?>
<style type="text/css">
body.buddypress .grid-container {
min-height: 100vh;
display: grid;
grid-template-columns: 100%;
grid-template-areas: "h"
"m"
"s"
"f";
}
@media (min-width: 768px) {
body.buddypress .grid-container {
grid-template-columns: 250px 1fr;
grid-template-rows: auto 1fr auto;
grid-template-areas: "h h"
"s m"
"f f";
}
}
</style>
<?php
}
// What to do when Both BP Sidebar and regular Sidebar are activated
if ( get_theme_mod( 'buddypress-sidebars' ) == "sidebars-on" ) {
?>
<style type="text/css">
body.buddypress .grid-container {
min-height: 100vh;
display: grid;
grid-template-columns: 100%;
grid-template-areas: "h"
"m"
"s"
"b"
"f";
}
@media (min-width: 768px) {
body.buddypress .grid-container {
grid-template-columns: 250px 1fr 250px;
grid-template-rows: auto 1fr auto;
grid-template-areas: "h h h"
"s m b"
"f f f";
}
}
</style>
<?php
}
}
add_action ( 'wp_enqueue_scripts', 'buddypress_page_layout' );
<?php if ( is_active_sidebar( 'sidebar-2' ) && get_theme_mod( 'buddypress-sidebars' ) != 'sidebars-off') : ?>
<aside id="buddypress-sidebar" class="buddypress-widget-area">
<div class="buddypress-widget-container">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div>
</aside><!-- #secondary -->
<?php endif; ?>
if(($apple==1 || $orange==2) && cake==0)
<?php if ( ( is_active_sidebar( 'sidebar-2' ) || get_theme_mod( 'buddypress-sidebars' ) != 'sidebars-off') && get_theme_mod( 'buddypress-sidebars' ) != false) : ?>