]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/default/archive.php
Wordpress 3.0.3-scripts
[autoinstalls/wordpress.git] / wp-content / themes / default / archive.php
index 769f9abd14a03d0eb2733bc81c5fcfabf439bee8..70c2a8cec8273aba0febc3543d65a7519339dad3 100644 (file)
@@ -1,7 +1,14 @@
-<?php get_header(); ?>
+<?php
+/**
+ * @package WordPress
+ * @subpackage Default_Theme
+ */
+
+get_header();
+?>
+
+       <div id="content" class="narrowcolumn" role="main">
 
-       <div id="content" class="narrowcolumn">
-<?php is_tag(); ?>
                <?php if (have_posts()) : ?>
 
          <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
@@ -28,7 +35,7 @@
                </div>
 
                <?php while (have_posts()) : the_post(); ?>
-               <div class="post">
+               <div <?php post_class() ?>>
                                <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
                                <small><?php the_time('l, F jS, Y') ?></small>
 
                        <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
                        <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
                </div>
-
-       <?php else : ?>
-
-               <h2 class="center">Not Found</h2>
-               <?php include (TEMPLATEPATH . '/searchform.php'); ?>
-
-       <?php endif; ?>
+       <?php else :
+
+               if ( is_category() ) { // If this is a category archive
+                       printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
+               } else if ( is_date() ) { // If this is a date archive
+                       echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
+               } else if ( is_author() ) { // If this is a category archive
+                       $userdata = get_userdatabylogin(get_query_var('author_name'));
+                       printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
+               } else {
+                       echo("<h2 class='center'>No posts found.</h2>");
+               }
+               get_search_form();
+
+       endif;
+?>
 
        </div>