Posted By

svenkaemper on 01/07/10


Tagged

wordpress excerpt


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

maxvee8


Excerpts in WordPress


 / Published in: PHP
 

  1. <?php
  2. //display all post titles, and if an excerpt exists, show it
  3. $posts=get_posts('post_type=post&showposts=-1');
  4. if ($posts) {
  5. foreach($posts as $post) {
  6. setup_postdata($post);
  7. ?>
  8. <p><?php the_time('m.d.y') ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
  9. <?php
  10. if ($post->post_excerpt) {
  11. echo 'excerpt is:' . $post->post_excerpt;
  12. }
  13. }
  14. }
  15. ?>

Report this snippet  

You need to login to post a comment.