Advertisement
Guest User

archives

a guest
Dec 2nd, 2011
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.         <?php if (have_posts()) : ?>
  4.  
  5.             <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
  6.  
  7.             <?php /* If this is a category archive */ if (is_category()) { ?>
  8.                 <h2 class="content"><?php single_cat_title(); ?></h2>
  9.  
  10.             <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
  11.                 <h2>Posts Tagged &#8216;<?php single_tag_title(); ?>&#8217;</h2>
  12.  
  13.             <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
  14.                 <h2>Archive for <?php the_time('F jS, Y'); ?></h2>
  15.  
  16.             <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
  17.                 <h2>Archive for <?php the_time('F, Y'); ?></h2>
  18.  
  19.             <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
  20.                 <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
  21.  
  22.             <?php /* If this is an author archive */ } elseif (is_author()) { ?>
  23.                 <h2 class="pagetitle">Author Archive</h2>
  24.  
  25.             <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
  26.                 <h2 class="pagetitle">Blog Archives</h2>
  27.            
  28.             <?php } ?>
  29.  
  30.             <?php while (have_posts()) : the_post(); ?>
  31.            
  32.                 <article <?php post_class() ?>>
  33.                
  34.                         <h2 class="content"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  35.  
  36.                 </article>
  37.  
  38.             <?php endwhile; ?>
  39.            
  40.     <?php else : ?>
  41.  
  42.         <h2>Nothing found</h2>
  43.  
  44.     <?php endif; ?>
  45.  
  46. <?php get_sidebar(); ?>
  47.  
  48. <?php get_footer(); ?>
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement