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.

6 Responses

  1. Kai Chan Vong's Gravatar

    Posted by Kai Chan Vong on Jul 29, 2007 at 01:08pm

    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's Gravatar

    Posted by nate on Jul 29, 2007 at 02:25pm

    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's Gravatar

    Posted by Kai Chan Vong on Jul 29, 2007 at 02:44pm

    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's Gravatar

    Posted by nate on Jul 29, 2007 at 02:49pm

    Kai,

    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.

    Peace.

  5. Kai Chan Vong's Gravatar

    Posted by Kai Chan Vong on Jul 29, 2007 at 03:01pm

    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.

    http://www.kaivong.com/blog/

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

  6. nate's Gravatar

    Posted by nate on Jul 29, 2007 at 03:22pm

    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.

Add a Response