1<?php
2
3get_header();
4
5if ( have_posts() ) :
6 ?>
7 <h2>Archive Page</h2>
8 <?php
9 while ( have_posts() ) : the_post(); ?>
10
11 <article class="post">
12 <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2>
13 <p class="post-meta"><?php the_time( 'F jS, Y' ); ?> | <a
14 href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author(); ?></a>
15 | <?php
16 $categories = get_the_category();
17 $comma = ', ';
18 $output = '';
19
20 if ( $categories ) {
21 foreach ( $categories as $category ) {
22 $output .= '<a href="' . get_category_link( $category->term_id ) . '">' . $category->cat_name . '</a>' . $comma;
23 }
24 echo trim( $output, $comma );
25 } ?>
26 </p>
27 <?php the_content() ?>
28 </article>
29
30 <?php endwhile;
31
32else :
33 echo '<p>There are no posts!</p>';
34
35endif;
36
37get_footer();
38
39?>
40
41
42