-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.php
106 lines (97 loc) · 3.31 KB
/
archive.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
<?php
/**
* The template for displaying Archive pages.
*
* @package YIKES Starter
*/
// Defaults
$current_archive = get_queried_object();
$current_count = ( isset( $current_archive->count ) ) ? $current_archive->count : 0;
$archive_icon = lwtv_plugin()->get_symbolicon( svg: 'newspaper.svg', fontawesome: 'fa-newspaper' );
$archive_details = '';
// translators: %s is the number of articles.
$archive_subheader = '<span class="post-count">' . sprintf( _n( '%s article', '%s articles', $current_count ), number_format_i18n( $current_count ) ) . '</span>';
// Custom header info
if ( is_author() ) {
// Authors:
$author = get_the_author_meta( 'ID' );
$archive_icon = get_avatar( get_the_author_meta( 'user_email' ), 96, '', 'Avatar for author ' . get_the_author_meta( 'display_name' ) );
$archive_subheader = lwtv_plugin()->get_author_social( $author );
$archive_details = lwtv_plugin()->get_author_favorite_shows( $author );
} elseif ( is_tag() ) {
$tag_id = get_queried_object()->term_id;
$archive_icon = lwtv_plugin()->get_symbolicon( svg: 'tag.svg', fontawesome: 'fa-tag' );
$archive_details = lwtv_plugin()->get_related_archive_header( $tag_id );
}
get_header(); ?>
<div class="archive-subheader">
<div class="jumbotron">
<div class="container">
<section class="archive-header">
<div class="row">
<div class="col-10">
<?php the_archive_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php
if ( isset( $archive_subheader ) ) {
echo '<div class="archive-description">';
echo $archive_subheader; // phpcs:ignore WordPress.Security.EscapeOutput
echo '</div>';
}
?>
</div>
<div class="col-2 icon plain">
<div class="archive-header-icon">
<?php echo $archive_icon; // phpcs:ignore WordPress.Security.EscapeOutput ?>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="archive-header-details">
<div class="archive-description">
<?php the_archive_description(); ?>
<?php echo $archive_details; // phpcs:ignore WordPress.Security.EscapeOutput ?>
</div>
</div>
</div>
</div>
</section><!-- .archive-header -->
</div><!-- .container -->
</div><!-- /.jumbotron -->
</div>
<div id="main" tabindex="-1" class="site-main" role="main">
<div class="container">
<div class="row">
<div class="col-sm-9">
<div id="primary" class="content-area">
<div id="content" class="site-content clearfix">
<?php
if ( have_posts() ) :
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="row site-loop main-posts-loop">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content/posts' );
endwhile;
else :
get_template_part( 'template-parts/content/none' );
endif;
?>
</div>
<?php wp_bootstrap_pagination(); ?>
</div>
</article><!-- #post-## -->
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- .col-sm-9 -->
<div class="col-sm-3 site-sidebar site-loop">
<?php get_sidebar(); ?>
</div><!-- .col-sm-3 -->
</div><!-- .row -->
</div><!-- .container -->
</div><!-- #main -->
<?php
get_footer();