Twitter Bootstrap 3 WordPress Starter Theme for Developers

Home Community Tips and Tricks Filter the_content with Read More without touching theme files

This topic contains 0 replies, has 1 voice, and was last updated by  danny 6 years, 10 months ago.

  • Author
  • #281


    If you paste this into your child theme (or just theme) functions.php file you can control the post output length with a read more without editing any theme files directly. Just change the $length and $read_more_text to whatever is desired.

    A warning this will bust apart any HTML tags that are not closed so be careful here. If your blog posts are pretty “media rich” I would switch out the_content for the_excerpt maybe in your theme files and NOT use this method.

You must be logged in to reply to this topic.