Getting the excerpt to work
-
Hey guys,
I’m been checking previous posts and experimenting with my own files. I can’t find where I should put this script:
<?php if(is_category() || is_archive()) {
the_excerpt();
} else {
the_content();
} ?>In my code so I don’t have a big long page full of blog posts to scroll down through.
I tried putting it in the index but nothing happened on the blog page.
Where does this code go?
The index code I’m working with looks like this:
<?php get_header(); ?> <div class="main"> <div class="col2"> <div class="left"> <div class="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1> <div class="descr"><?php the_time('F jS, Y') ?> by <?php the_author() ?><?php edit_post_link('Edit post',' ~ ',''); ?></div> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <p class="info">Posted in <?php the_category(', ') ?> having <?php comments_popup_link('no comments »', '1 comment »', '% comments »'); ?></p> </div> <?php comments_template(); ?> <?php endwhile; ?> <div class="left"><?php next_posts_link('« Previous Entries') ?></div> <div class="right"><?php previous_posts_link('Next Entries »') ?></div> <div class="clearer"></div> <?php else : ?> <h2 align="center">Not Found</h2> <p align="center">Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting the excerpt to work’ is closed to new replies.