Get Posts
-
I’m using the “get-posts” code to place excerpts from previous posts at the bottom of my page. Here is the code:
<?php
$posts = get_posts('offset=3');
foreach ($posts as $post) :
?>- "><?php the_title() ?> --- <?php the_excerpt() ?>
<div class="meta">Posted on <?php the_time('F jS Y @ g:ia',display); ?> <?php _e("Then stored in:"); ?> <?php the_category() ?></div>
<?php
endforeach;
?>
I want to do two things:
1. I want to shorten the excerpt that appears on the page to just a few lines. Can anyone tell me how to change this code to do that?
2. I want to include “comments” so that readers can see if there were comments to the post. Everything I’ve read about “comments” says the code has to be INSIDE the LOOP but the above code has to be OUTSIDE the LOOP. Any ideas on how I can add this?
TIA…
The topic ‘Get Posts’ is closed to new replies.