WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to show a post with post title and post content of 400/550 words with a read more link in my category page. I have already done this, but problem is, my post doesn't display the excerpt as it should.

This in my code below.

<?php while ( have_posts() ) : the_post(); ?>
<div class="news">
<div class="grid-container">

  <h2><a href="<?php the_permalink(); ?>" >
    <?php the_title(); ?>
    </a><span class="line"></span></h2>

  <?php  the_post_thumbnail() ?>
  <div class="newsevent"><?php echo substr(get_the_excerpt(), 0,400); ?></div>
  <a href="<?php the_permalink(); ?>" class="readmore">View</a> </div>
<?php endwhile; 


I suspect I need to change <?php echo substr(get_the_excerpt(), 0,400); ?>

share|improve this question
possible duplicate of Allow html in excerpt – Pieter Goosen Jun 10 '14 at 12:58
Nearly everything you want to know about the excerpt is covered in above link – Pieter Goosen Jun 10 '14 at 12:59
up vote 0 down vote accepted

1) Follow this post on Stackoverflow or the link given by @PieterGoosen.

2) You can also use get_the_content() instead of get_the_excerpt()

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.