Skip to main content

Ivan Teoh

Something personal yet public

98-index-before.php

(Source)

<?php
/**
 * @package WordPress
 * @subpackage Your_Theme
 */
?>
<?php get_header(); ?>
<div id="container">
<div id="content">
<!-- archive -->
<?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><?php _e('Archive for the &#8216;') ?><?php single_cat_title(); ?>
      <?php _e('&#8217; Category') ?></h2>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h2><?php _e('Posts Tagged &#8216;') ?><?php single_tag_title(); ?>
      <?php _e('&#8217;') ?></h2>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2><?php _e('Archive for') ?> <?php the_time('F jS, Y'); ?></h2>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2><?php _e('Archive for') ?> <?php the_time('F, Y'); ?></h2>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2><?php _e('Archive for') ?> <?php the_time('Y'); ?></h2>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2><?php _e('Author Archive') ?></h2>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) &&
      !empty($_GET['paged'])) { ?>
    <h2><?php _e('Blog Archives') ?></h2>
    <?php } ?>
    <?php while (have_posts()) : ?>
        <?php the_post(); ?>
        <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
        <div class="entry-title">
        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php
          printf( __('Permalink Link to %s'), the_title_attribute('echo=0') );
          ?>"><?php the_title(); ?></a></h2>
        </div><!-- .entry-title -->
        <div class="entry-content">
        <?php the_excerpt(); ?>
        <p><?php wp_link_pages(); ?></p>
        </div><!-- .entry-content -->
        <div class="entry-meta">
        <p><?php _e('Posted by'); ?> <?php the_author(); ?> @ <?php
          the_time('F jS, Y'); ?> <?php _e('in'); ?> <?php the_category(',');
          ?> <?php the_tags(__('with '), ', '); ?></p>
        <p><?php comments_popup_link(__('No Comments &#187;'),
          __('1 Comment &#187;'), __('% Comments &#187;')); ?> <?php
          edit_post_link(__('Edit This'), '&#8212;'); ?></p>
        </div><!-- .entry-meta -->
        </div>
        <?php comments_template(); ?>
    <?php endwhile; ?>
    <p><?php next_posts_link(__('&laquo; Older Posts')); ?></p>
    <p><?php previous_posts_link(__('Newer Posts &raquo;')); ?></p>
<?php else : ?>
<h2><?php _e('Not Found'); ?></h2>
<p><?php _e('Sorry, but you are looking for something that isn&#39;t here.');
  ?></p>
<?php endif; // END: if ( have_posts() ) ?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>