-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory-response-pieces.php
100 lines (75 loc) · 2.94 KB
/
category-response-pieces.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
<?php get_header(); ?>
<main class="main" role="main">
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<?php
$category_id = get_query_var('cat');
$category = get_category($category_id);
$category_parent_id = $category->category_parent;
$title = single_cat_title("", false);
if ( $category_parent_id === 36 ) {
// 36 is the category id of `Print Archives`
echo '<h1 class="title is-page-title is-normal-case">' . $title . '</h1>';
} elseif ( $category_parent_id === 10 ) {
// 10 is the category id of `Law Review Online`
echo '<h1 class="title is-page-title">Law Review Online</h1>';
} else {
echo '<h1 class="title is-page-title">' . $title . '</h1>';
}
?>
</div>
</div>
</section>
<?php if ( $category_id === 175 || $category_parent_id === 175): ?>
<nav class="nav nav-secondary has-shadow">
<div class="container">
<div class="nav-center">
<?php
$my_menu = array (
'menu' => 'Response Piece Subnav',
'walker' => new Class_Name_Walker,
'container' => false,
'items_wrap' => '%3$s',
'depth' => 0,
);
wp_nav_menu($my_menu); ?>
</div>
</div>
</nav>
<?php endif; ?>
<section class="section">
<div class="container">
<div class="columns">
<?php
if ( $category_id === 36 ) {
echo '<div class="column is-10 is-offset-1 table-of-contents">';
get_template_part('loop', 'index');
echo '</div>';
} elseif ( $category_id === 10 ) {
echo '<div class="column is-10 is-offset-1 main-content">';
get_template_part('loop', 'online');
get_template_part('pagination');
echo '</div>';
} elseif ( $category_id === 153 ) {
echo '<div class="column is-10 is-offset-1 main-content">';
get_template_part('loop', 'blog');
get_template_part('pagination');
echo '</div>';
} elseif ( $category_parent_id === 36 ) {
echo '<div class="column is-10 is-offset-1 table-of-contents">';
get_template_part('loop', 'print');
echo '</div>';
} else {
echo '<div class="column is-10 is-offset-1 main-content">';
get_template_part('loop');
get_template_part('pagination');
echo '</div>';
}
?>
<?php //get_template_part('pagination'); ?>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>