-
Notifications
You must be signed in to change notification settings - Fork 13
/
archives.php
64 lines (44 loc) · 1.42 KB
/
archives.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
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php if (is_category()) : ?>
<h1>Archive for the “<?php single_cat_title(); ?>” category</h1>
<?php elseif( is_tag() ) : ?>
<h1>Posts Tagged “<?php single_tag_title(); ?>”</h1>
<?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : ?>
<h1>Blog Archives</h1>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<section id="archive-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</header>
<section>
<?php the_content() ?>
</section>
<section>
<h2>Archives by Month:</h2>
<ul><?php wp_get_archives('type=monthly'); ?></ul>
</section>
<section>
<h2>Archives by Subject:</h2>
<ul><?php wp_list_categories(); ?></ul>
</section>
<footer>
</footer>
</section>
<?php endwhile; ?>
<?php if (show_posts_nav()) : ?>
<nav class="post-navigation">
<ul>
<li><?php next_posts_link('« Previous page') ?></li>
<li><?php previous_posts_link('Next page »') ?></li>
</ul>
</nav>
<?php endif; ?>
<?php else : ?>
<p>There are no posts.</p>
<p>Try searching:</p>
<?php get_search_form(); ?>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>