2

How would this be done with javascript or a plugin? This would prevent widows from happening in my WordPress posts. Shaun Inman has created a similar plugin for post titles, but not for actual posts. Can his plugin be modified to include posts?

http://shauninman.com/archive/2006/08/22/widont_wordpress_plugin

Here is a screenshot of my post with a widow:

http://cl.ly/image/0A0j383H0Z2U

2

Drop in add_filter( 'the_content', 'widont' ); (and the same for the_excerpt if required).

This'll apply the function to the post content in addition to the title (the_title).

  • That worked! I added that line of code directly underneath add_filter('the_title', 'widont'); – Dave Aug 21 '12 at 2:02

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.