Fixed Line Breaks

As you can see, I finally fixed the line break problem I was having here. I fixed it by adding a filter like this:

add_filter('the_content', 'wpautop');

I added this code to the header of each theme I have here and it took all the line breaks in the html and made them use paragraph tags instead. Thanks goodness. That was annoying.

Nate Ritter lives in the Pacific Northwest (U.S.), popularized the #hashtag and creates web applications for a living. He also does miles and point hacking to enable cheap travel for his family. More here →

6 Comments on "Fixed Line Breaks"

  1. Kai Chan Vong says:

    Aw man, I’m getting that if I use the wordpress email to blog feature.

    It seems to be something with 73 characters and then doing a break. I’ll try this and see if it fixes it, although I get the feeling this isn’t totally going to help is it?

    Thanks for posting this though.

  2. nate says:

    No problem Kai. I think your problem has more to do with how the email is being interpreted though. Some email programs automatically do line breaks at 73 characters regardless. So, I doubt this hack is going to fix your issue.

    What you might look at is doing something like checking for two line breaks (“\n\n”) and then swapping that out for two break tags. Then, do another check for any “\n” left and just str_replace it with a space. That should do the job for ya. I think.

  3. Kai Chan Vong says:

    Wow, cheers for that mate. By the way, I really love what you’ve done with your blog. Been spending a bit of time looking around it and I especially liked the little welcome email I got!

    Take care pal and thanks again, I’ll keep you updated on my progress when I get some time to try it out.

  4. nate says:


    Awesome! Thanks for the kudos. I appreciate it. If there’s anything else I can do for ya, let me know. I’m just happy to be helpful.


  5. Kai Chan Vong says:

    No problem dude if you have a look at the site, it’s almost fixed it. I just need to spend a little more time thinking about why the = signs are coming up and then I think I’m all good to go.

    Cheers again, I look forward to reading through more of your blog when I have time.

  6. nate says:

    Ah yea, that’s usually the email program too.. :) Parsing email stinks sometimes, especially if you’re doing it from a cell phone or PDA. Then it can get crazy depending on your carrier.

More in General
4 Month Old Company Purchased by CNET

HeyPix Windup Labs purchased by CNET