Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I like to display only 20 lines of post with the read more link using

the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>' ) ); 

But it shows full content . How can i strip it .please help me !

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

You need to add a more quicktag to your content

See here: http://codex.wordpress.org/Customizing_the_Read_More

share|improve this answer
    
i red it . but couldn't manage to get it. please help me with code.There is lot about changing read more link style but how to strip the content. –  gowri Jun 8 '11 at 11:41
    
not sure what help you need - just add a more quicktag from the editor to your post. There isn't any code to change –  anu Jun 8 '11 at 11:49
    
on sidenote but in keeping with this post, using more tag to limit number of words can overflow if someone comes along and writes from a theosaurus, is there a similar function that can do character count inc whitespace anybody knows of? –  MartinJJ Jun 8 '11 at 12:14
    
Thank you so much .I have noticed many bad suggestion like using "substr". but i thought there should be a good way. that's You gave –  gowri Jun 8 '11 at 12:27
add comment

Several options:

  1. Manually add the <!--more--> link to each of your posts, at the appropriate location (as suggested by @spartacus)
  2. Filter $content at the the_content hook, to return the appropriate amount of content (I'm not sure how you would filter to return 20 lines of content), plus a read more link
  3. Use the_excerpt() instead of the_content(), and filter $excerpt at the excerpt_length hook, to return the appropriate number of words
share|improve this answer
add comment

Your Answer

 
discard

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.