-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
executable file
·108 lines (79 loc) · 2.26 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
107
108
<?php
/**
* The template for displaying archive pages.
* Template Name: Archive
*
* @package QOD_Starter_Theme
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main archive-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
?>
</header>
<!-- .page-header -->
<div class="archive-content">
<div class="quote-authors">
<h2>Quote Authors</h2>
<ul class= "author-list">
<?php
$posts = get_posts( array(
'numberposts' => -1,
));
foreach($posts as $post){
$author = get_the_title();
$postLink = get_permalink();
?>
<li><a href = "<?php echo $postLink?>"><?php echo $author ?></a></li>
<?php } ?>
</ul>
</div><!-- authors -->
<div class="categories">
<h2>Categories</h2>
<ul class="category-list">
<?php
$categories = get_categories( array(
'orderby' => 'name',
'order' => 'ASC',
));
foreach( $categories as $category ) {
$categorylink = home_url('/category/') . $category->slug;
?>
<!-- DO -->
<li><a href = <?php echo "$categorylink" ?> class = "category-link"><?php echo $category->name ?></a></li>
<?php } ?>
</ul>
</div> <!-- categories -->
<div class="tags">
<h2>Tags</h2>
<ul class="tags-list">
<?php
$tags = get_tags( array(
'orderby' => 'name',
'order' => 'ASC',
));
foreach( $tags as $tag ) {
$taglink = home_url('/tag/') . $tag->slug;
?>
<!-- DO -->
<li><a href = <?php echo "$taglink" ?> class = "tag-link"><?php echo $tag->name ?></a></li>
<?php } ?>
</ul>
</div><!-- tags -->
</div><!-- archive-content -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'template-parts/content' );
?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>