1

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 !

3

You need to add a more quicktag to your content

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

  • 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
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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