Title: Archieve.php Help? (code avail.)
Last modified: August 19, 2016

---

# Archieve.php Help? (code avail.)

 *  [MarshallB](https://wordpress.org/support/users/marshallb/)
 * (@marshallb)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/archievephp-help-code-avail/)
 * This is the code for my archive page:
 *     ```
       <?php
       /*
       Template Name: Archive
       */
       ?>
   
       <?php get_header(); ?>
       <?php get_sidebar(); ?>
   
       <!-- Content Display START -->
       <div id="content">
       		<?php if (have_posts()) : ?>
   
       			<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
   
       			<?php /* If this is a category archive */ if (is_category()) { ?>
       			<h2 class="archivetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</h2>
   
       			<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
       			<h2 class="archivetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
   
       			<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
       			<h2 class="archivetitle">Archive for <?php the_time('F, Y'); ?></h2>
   
       			<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
       			<h2 class="archivetitle">Archive for <?php the_time('Y'); ?></h2>
   
       			<?php /* If this is a search */ } elseif (is_search()) { ?>
       			<h2 class="archivetitle">Search Results</h2>
   
       			<?php /* If this is an author archive */ } elseif (is_author()) { ?>
       			<h2 class="archivetitle">Author Archive</h2>
   
       			<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
       			<h2 class="archivetitle">Blog Archive</h2>
   
       		<?php } ?>
   
       		<?php while (have_posts()) : the_post(); ?>
       		<div class="post">
       			<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
       			<small><?php the_time('l, F jS, Y') ?></small>
   
       			<div class="entry">
                                    <?php the_excerpt() ?>
       			</div>
   
       			<p class="postmetadata">Filed under: <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> 
   
       		</div>
       	<div class="postbottom">&nbsp;</div>
       		<?php endwhile; ?>
   
       		<div class="navigation">
       			<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
       			<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
       		</div>
   
       	 <?php else : ?>
                  <div class="post">
       		<h2>Not Found</h2>
       		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
                  </div>
       <div class="postbottom">&nbsp;</div>
       	<?php endif; ?>
   
       	</div>
   
       <?php get_footer(); ?>
       ```
   
 * When I view the page by clicking the link in the Pages nav from the side bar 
   it ends up looking like this [http://img199.imageshack.us/img199/9833/archivepage.png](http://img199.imageshack.us/img199/9833/archivepage.png)
 * No content shows up other than the date, and Filed under info.
    Why would this
   be happening? Page has a default parmalink of [http://—-.—-.org/?p=123](http://—-.—-.org/?p=123)

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/archievephp-help-code-avail/#post-1140436)
 * Update permalink structure.
 * If that doesn’t resolve, then if necessary deactivate all plugins and switch 
   to the WordPress Default Theme.
 * Also look at your .htaccess to see if there’s a problem there.

Viewing 1 replies (of 1 total)

The topic ‘Archieve.php Help? (code avail.)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/archievephp-help-code-avail/#post-1140436)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
