Support » Fixing WordPress » Display post excerpts without images.

  • Resolved bencharity


    At the end of each of my pages I display the two latest posts (with a short excerpt) as part of my page footer.

    However the images in my posts are screwing it up. Is there a way to call the excerpt excluding the images of a post? It seems as though this should be a simple command, but I can’t seem to find any documentation.

    My code:

    <div id="latestBlog">
    	<?php $temp_query = $wp_query; ?>
    global $more;
    // set $more to 0 in order to only get the first part of the post
    $more = 0;
    <?php while (have_posts()) : the_post(); ?>
      <div class="post" id="post-<?php the_ID(); ?>">
      <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
     <div class="entry">
       <?php the_content('<span class="moretext">[continue reading...]</span>'); ?>
    <?php endwhile; ?>
    </div>  <!-- end #latestBlog -->

    You can see how it is screwing up the bottom of my page here:

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display post excerpts without images.’ is closed to new replies.