-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtaxonomy-fcn_genre.php
108 lines (85 loc) · 2.5 KB
/
taxonomy-fcn_genre.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
101
102
103
104
105
106
107
108
<?php
/**
* Genre custom taxonomy archives
*
* @package WordPress
* @subpackage Fictioneer
* @since 4.6.0
* @see partials/_archive-loop.php
*/
// Header
get_header();
// Setup
$term = get_queried_object();
$parent = get_term_by( 'id', $term->parent, get_query_var( 'taxonomy' ) );
$output = [];
// Heading
$output['heading'] = '<h1 class="archive__heading">' . sprintf(
_n(
'<span class="archive__heading-number">%1$s</span> Result with the <em>"%2$s"</em> genre %3$s',
'<span class="archive__heading-number">%1$s</span> Results with the <em>"%2$s"</em> genre %3$s',
$term->count,
'fictioneer'
),
$term->count,
single_tag_title( '', false ),
$parent ? sprintf( _x( '(%s)', 'Taxonomy page parent suffix.', 'fictioneer' ), $parent->name ) : ''
) . '</h1>';
// Description
if ( ! empty( $term->description ) ) {
$output['description'] = '<p class="archive__description">' . sprintf(
__( '<strong>Definition:</strong> %s', 'fictioneer' ),
$term->description
) . '</p>';
}
// Divider
$output['divider'] = '<hr class="archive__divider">';
// Tax cloud
$output['tax_cloud'] = '<div class="archive__tax-cloud">' . wp_tag_cloud(
array(
'fictioneer_query_name' => 'tag_cloud',
'smallest' => .625,
'largest' => 1.25,
'unit' => 'rem',
'number' => 0,
'taxonomy' => ['fcn_genre'],
'exclude' => $term->term_id,
'show_count' => true,
'pad_counts' => true,
'echo' => false
)
) . '</div>';
?>
<main id="main" class="main archive genre-archive">
<?php do_action( 'fictioneer_main', 'genre-archive' ); ?>
<div class="main__wrapper">
<?php do_action( 'fictioneer_main_wrapper' ); ?>
<article class="archive__article">
<header class="archive__header"><?php
echo implode( '', apply_filters(
'fictioneer_filter_archive_header',
$output,
'fcn_genre',
$term,
$parent
));
?></header>
<?php get_template_part( 'partials/_archive-loop', null, array( 'taxonomy' => 'fcn_genre' ) ); ?>
</article>
</div>
<?php do_action( 'fictioneer_main_end', 'genre-archive' ); ?>
</main>
<?php
// Footer arguments
$footer_args = array(
'post_type' => null,
'post_id' => null,
'template' => 'taxonomy-fcn_genre.php',
'breadcrumbs' => array(
[fcntr( 'frontpage' ), get_home_url()],
[sprintf( __( 'Results for Genre "%s"', 'fictioneer' ), single_tag_title( '', false ) ), null]
)
);
// Get footer with breadcrumbs
get_footer( null, $footer_args );
?>