-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar.php
44 lines (42 loc) · 1007 Bytes
/
sidebar.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
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package YIKES Starter
*/
if ( ! is_active_sidebar( 'sidebar-2' ) ) {
return;
}
?>
<aside id="secondary" class="widget-area" role="complementary">
<?php
// Show the right sidebar for the page type.
if ( ! is_singular() ) {
switch ( get_post_type() ) {
case 'post_type_actors':
dynamic_sidebar( 'archive-actor-sidebar' );
break;
case 'post_type_characters':
dynamic_sidebar( 'archive-character-sidebar' );
break;
case 'post_type_shows':
dynamic_sidebar( 'archive-show-sidebar' );
break;
default:
dynamic_sidebar( 'sidebar-2' );
break;
}
} else {
switch ( get_post_type() ) {
case 'post_type_actors':
case 'post_type_characters':
case 'post_type_shows':
get_template_part( 'template-parts/sidebar/' . get_post_type(), '', array( 'the_post_id' => get_the_ID() ) );
break;
default:
dynamic_sidebar( 'sidebar-2' );
break;
}
}
?>
</aside><!-- #secondary -->