-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar.php
More file actions
101 lines (95 loc) · 3.24 KB
/
Copy pathsidebar.php
File metadata and controls
101 lines (95 loc) · 3.24 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* The sidebar containing the main widget area
*
* @package Cielos
* @since unomoon 1.0.0
*/
?>
<aside class="sidebar lg:col-span-1" id="side-nav">
<div id="header-widget-area" class="space-y-6">
<div class="widget-search">
<?php get_template_part('searchform'); ?>
</div><!-- .widget-search end -->
<?php if (is_category() ) : ?>
<div class="rss-link bg-[var(--c-panel)] border border-[var(--c-border)] rounded-lg p-4 shadow-sm">
<a href="<?php echo get_category_feed_link($cat); ?>" class="flex items-center gap-2 text-sm font-semibold text-[var(--c-primary)] hover:text-[var(--c-primary-dark)] hover:underline transition-colors duration-200">
<i class="i-carbon-rss text-orange-500"></i>
<span>RSS フィード</span>
</a>
</div>
<?php endif; ?>
</div><!-- #header-widget-area end -->
<?php if (is_tag()) : ?>
<div class="widget widget_categories mt-6">
<h3 class="widget-title">
<i class="i-carbon-folder" aria-hidden="true"></i>
カテゴリー
</h3>
<ul>
<?php
$categories = get_categories(array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => true,
));
foreach ($categories as $category) :
?>
<li class="cat-item">
<a href="<?php echo esc_url(get_category_link($category->term_id)); ?>">
<?php echo esc_html($category->name); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php
// 僭越図書館の子ページの場合、僭越図書館ウィジェットを表示
$is_biblio_child = is_page() && (get_the_ID() == 2410 || wp_get_post_parent_id(get_the_ID()) == 2410);
if ($is_biblio_child) :
// ジャンル別一覧リスト
ob_start();
wp_list_categories(
array(
'taxonomy' => 'genre',
'title_li' => '',
'hide_empty' => true,
'current_category' => get_queried_object_id(),
'show_option_none' => '',
'depth' => 1,
)
);
$genre_list = ob_get_clean();
$genre_list_with_suffix = preg_replace('/<\/a>/', '作品一覧</a>', $genre_list);
?>
<!-- 僭越図書館 -->
<div class="widget widget_pages mt-6">
<h3 class="widget-title">
<i class="i-carbon-book" aria-hidden="true"></i>
僭越図書館
</h3>
<ul>
<?php wp_list_pages(array('child_of' => '2410', 'title_li' => '', 'depth' => 1)); ?>
</ul>
</div>
<!-- 僭越図書館ジャンル別一覧ページ -->
<div class="widget widget_pages mt-6">
<h3 class="widget-title">
<i class="i-carbon-folder" aria-hidden="true"></i>
僭越図書館ジャンル別一覧ページ
</h3>
<ul><?php echo $genre_list_with_suffix; ?></ul>
</div>
<?php endif; ?>
<?php if (is_active_sidebar('sidebar')) : ?>
<div class="space-y-6">
<?php dynamic_sidebar('sidebar'); ?>
</div>
<?php endif; ?>
<?php if (is_active_sidebar('sidebar-scroll')) : ?>
<div class="sidebar-scroll-area space-y-6 sticky top-4">
<?php dynamic_sidebar('sidebar-scroll'); ?>
</div>
<?php endif; ?>
</aside>