This repository was archived by the owner on Aug 22, 2019. It is now read-only.
forked from castlegateit/cgit-zero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage-archives.php
More file actions
62 lines (45 loc) · 1.29 KB
/
page-archives.php
File metadata and controls
62 lines (45 loc) · 1.29 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
<?php
/**
* Archives Page template
*
* This template displays the site archives by month, category, and tag. It
* will be used by a page with the "archives" slug. Alternatively, change the
* file name and add a "Template Name" comment to allow the template to be
* selected in the WordPress admin section.
*/
?>
<?php get_header(); ?>
<div class="main">
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); // Start loop ?>
<h1><?php the_title(); ?></h1>
<?php the_content('Read more'); // Print content ?>
<?php endwhile; ?>
<?php endif; ?>
<h2>Archives by month</h2>
<ul>
<?php
// Print archives by month
wp_get_archives(
array(
'type' => 'monthly',
'limit' => 12
)
);
?>
</ul>
<?php if(get_terms('category')): ?>
<h2>Archives by category</h2>
<ul>
<?php echo z_taxon_list('category'); ?>
</ul>
<?php endif; ?>
<?php if(get_terms('post_tag')): ?>
<h2>Archives by category</h2>
<ul>
<?php echo z_taxon_list('post_tag'); ?>
</ul>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>