• I’d like to show only a summary on the archives page, and the full text on the index. This is the code for my index. Is there some way to limit what is shown on the archive pages to show only the title and summary?

    <?php get_header(); ?>
    
    <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="archive">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
    <?php /* If this is a tag */ } elseif (is_tag()) { ?>
    <h2 class="archive">Archive for the ‘<?php single_tag_title(); ?>’ tag</h2>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2 class="archive">Archive for <?php the_time('F jS, Y'); ?></h2>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2 class="archive">Archive for <?php the_time('F, Y'); ?></h2>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2 class="archive">Archive for <?php the_time('Y'); ?></h2>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2 class="archive">Author Archive</h2>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h2 class="archive">Blog Archives</h2>
    <?php } ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <p class="comments"><a href="<?php comments_link(); ?>"><?php comments_number('make comments','with one comment','with % comments'); ?></a></p>
    
    <div class="main">
    	<?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>
    
    <div class="meta group">
    <div class="signature">
        <p>Written by <?php the_author() ?> <span class="edit"><?php edit_post_link('Edit'); ?></span></p>
        <p><?php the_time('F jS, Y'); ?> <?php _e("at"); ?> <?php the_time('g:i a'); ?></p>
        <p>Posted in <?php the_category(',') ?></p>
        <?php if ( the_tags('<p>Tagged with ', ', ', '</p>') ) ?>
    </div>
    <div class="tags">
        <p><?php if(function_exists('wp_email')) { email_link(); } ?></p>
        <p><?php if(function_exists('wp_print')) { print_link(); } ?></p>
    </div>
    </div>
    
    <?php if ( comments_open() ) comments_template(); ?>
    
    <?php endwhile; else: ?>
    <div class="warning">
    	<p>Sorry, but you are looking for something that isn't here.</p>
    </div>
    <?php endif; ?>
    
    <div class="navigation group">
    	<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    	<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    
    </div> 
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • find <?php the_content(‘Read the rest of this entry »’); ?>
    in archive.php and change the_content to the_excerpt.

    Thread Starter adamsmark

    (@adamsmark)

    Thanks, tried that. Doesn’t look good on my theme. So next question, how about just listing titles?

    Hmmm… If you really have an archive.php file in your theme – why do you need all that “archive related garbage” in the index.php file (as you stated in your original post?

    And if you want just title – don’t use any other template tag, meaning delete the_content or the_excerpt (whichever is there).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing full article on index page, summary on archive pages’ is closed to new replies.