-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsidebar.php
More file actions
48 lines (36 loc) · 865 Bytes
/
Copy pathsidebar.php
File metadata and controls
48 lines (36 loc) · 865 Bytes
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
<?php
/**
* The sidebar containing the main widget area.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Idealx
* @since 1.0.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( function_exists( 'dynamic_sidebar' ) ) {
global $post;
global $woocommerce;
$idealx_posttype = get_post_type( $post );
if ( (
( is_archive() )
|| ( is_author() )
|| ( is_category() )
|| ( is_home() )
|| ( is_single() )
|| ( is_tag() )
)
&& ( 'post' === $idealx_posttype ) ) {
dynamic_sidebar( 'Blog Sidebar' );
} elseif ( $woocommerce && is_shop()
|| $woocommerce && is_product_category()
|| $woocommerce && is_product_tag()
|| $woocommerce && is_product() ) {
dynamic_sidebar( 'WooCommerce Sidebar' );
} else {
dynamic_sidebar( 'Page Sidebar' );
}
}