[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

/wp-content/themes/default/ -> archive.php (source)

   1  <?php
   2  /**
   3   * @package WordPress
   4   * @subpackage Default_Theme
   5   */
   6  
   7  get_header();
   8  ?>
   9  
  10      <div id="content" class="narrowcolumn" role="main">
  11  
  12          <?php if (have_posts()) : ?>
  13  
  14         <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
  15         <?php /* If this is a category archive */ if (is_category()) { ?>
  16          <h2 class="pagetitle">Archive for the &#8216;<?php single_cat_title(); ?>&#8217; Category</h2>
  17         <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
  18          <h2 class="pagetitle">Posts Tagged &#8216;<?php single_tag_title(); ?>&#8217;</h2>
  19         <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
  20          <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
  21         <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
  22          <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
  23         <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
  24          <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
  25        <?php /* If this is an author archive */ } elseif (is_author()) { ?>
  26          <h2 class="pagetitle">Author Archive</h2>
  27         <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
  28          <h2 class="pagetitle">Blog Archives</h2>
  29         <?php } ?>
  30  
  31  
  32          <div class="navigation">
  33              <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
  34              <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
  35          </div>
  36  
  37          <?php while (have_posts()) : the_post(); ?>
  38          <div <?php post_class() ?>>
  39                  <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>
  40                  <small><?php the_time('l, F jS, Y') ?></small>
  41  
  42                  <div class="entry">
  43                      <?php the_content() ?>
  44                  </div>
  45  
  46                  <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
  47  
  48              </div>
  49  
  50          <?php endwhile; ?>
  51  
  52          <div class="navigation">
  53              <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
  54              <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
  55          </div>
  56      <?php else :
  57  
  58          if ( is_category() ) { // If this is a category archive
  59              printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
  60          } else if ( is_date() ) { // If this is a date archive
  61              echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
  62          } else if ( is_author() ) { // If this is a category archive
  63              $userdata = get_userdatabylogin(get_query_var('author_name'));
  64              printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
  65          } else {
  66              echo("<h2 class='center'>No posts found.</h2>");
  67          }
  68          get_search_form();
  69  
  70      endif;
  71  ?>
  72  
  73      </div>
  74  
  75  <?php get_sidebar(); ?>
  76  
  77  <?php get_footer(); ?>


Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7