Repository navigation
Expand file tree
/
Copy pathsidebar.php
More file actions
78 lines (61 loc) · 2.48 KB
/
Copy pathsidebar.php
File metadata and controls
78 lines (61 loc) · 2.48 KB
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
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package stax
*/
namespace Stax;
use Stax\Customizer\Config;
?>
<?php if ( stax()->is_primary_sidebar_active() ) : ?>
<?php
if ( is_single() ) {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_POST_STICKY_PRIMARY_SIDEBAR );
$gap = stax()->get_option( Config::OPTION_LAYOUT_POST_SIDEBAR_GAP );
} elseif ( is_archive() || is_search() || is_home() ) {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_ARCHIVE_STICKY_PRIMARY_SIDEBAR );
$gap = stax()->get_option( Config::OPTION_LAYOUT_ARCHIVE_SIDEBAR_GAP );
} else {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_GENERAL_STICKY_PRIMARY_SIDEBAR );
$gap = stax()->get_option( Config::OPTION_LAYOUT_GENERAL_SIDEBAR_GAP );
}
$sticky_class = $is_sticky ? 'svq-sticky-el' : '';
if ( $is_sticky ) {
\Stax_Assets::instance()->enqueue_hc_sticky();
}
?>
<div class="svq-sidebar-page primary-sidebar" id="primary-sidebar">
<div class="svq-sidebar-content widget-area <?php echo esc_attr( $sticky_class ); ?>"
data-stick-to="primary-sidebar" data-top="<?php echo esc_attr( $gap ); ?>">
<?php stax()->display_primary_sidebar(); ?>
</div>
</div><!-- #primary -->
<?php endif; ?>
<?php if ( stax()->is_secondary_sidebar_active() ) : ?>
<?php
if ( is_single() ) {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_POST_STICKY_SECONDARY_SIDEBAR );
$sticky_gap = stax()->get_option( Config::OPTION_LAYOUT_POST_SIDEBAR_GAP );
} elseif ( is_archive() || is_search() || is_home() ) {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_ARCHIVE_STICKY_SECONDARY_SIDEBAR );
$sticky_gap = stax()->get_option( Config::OPTION_LAYOUT_ARCHIVE_SIDEBAR_GAP );
} else {
$is_sticky = stax()->get_option( Config::OPTION_LAYOUT_GENERAL_STICKY_SECONDARY_SIDEBAR );
$sticky_gap = stax()->get_option( Config::OPTION_LAYOUT_GENERAL_SIDEBAR_GAP );
}
$sticky_class = $is_sticky ? 'svq-sticky-el' : '';
$gap = $sticky_gap;
if ( $is_sticky ) {
\Stax_Assets::instance()->enqueue_hc_sticky();
}
?>
<div class="svq-sidebar-page secondary-sidebar" id="secondary-sidebar">
<div class="svq-sidebar-content widget-area <?php echo esc_attr( $sticky_class ); ?>"
data-stick-to="secondary-sidebar" data-top="<?php echo esc_attr( $gap ); ?>">
<?php stax()->display_secondary_sidebar(); ?>
</div>
</div><!-- #secondary -->
<?php
endif;