This is a request for help from my readers. I’m trying to find out how to hack WP so that it will never insert <br> tags in my entries. I want it to ignore hard newlines, treating them as soft.
Sex, software, politics, and firearms. Life's simple pleasures…
This is a request for help from my readers. I’m trying to find out how to hack WP so that it will never insert <br> tags in my entries. I want it to ignore hard newlines, treating them as soft.
Duh…?
My WP does never insert ( are changed to it) automaticly.
It’s a surprise to me. So I’d wrote a simple test in my WP 1.5.2 here.
WP Unformatted: http://www.alexking.org/index.php?content=software/wordpress/content.php
It lets you add a custom field to each post which disables the auto-formatting. Not ideal, but it’s the best solution I’ve found without hacking the WP core. Does mean you have to set it each time you post though.
Are you a thrid party posting tool? Or simply straight through the web interface?
It’s probably done using nl2br(), a php function that converts newlines to HTML line breaks. Grepping for that and removing the calls should do it.
why not have a look at Text-Control
The Markdown plugin treats single newlines as all part of the same paragraph and doesn’t insert <br> tags for every newline. I’d recommend using that, although I don’t know if it’ll snip out the existing <br> tags you already have.
The text-control plugin seems to be a good solution to the problem.
Hello,
I put a possible (very rudimentary) solution to your problem in my blog:
http://www.math.tifr.res.in/blog/?p=182
I also think I messed up by clicking in the trackback, sorry about it.
Pablo.
IIRC, to disable it you have to: Search for a file called functions-formatting.php. Then search the line where wpautop is defined. It should say
function wpautop($pee, $br = 1)
. Change itfunction wpautop($pee, $br = 0)
. You should be done.Be aware it will modify your past posts too.
First time coming so I hope this works. :)
http://www.test.com12345
http://www.test.com12345 delete this comment
Your comment is being held for review. High in the glass-and-steel tower that is Making Light Headquarters your post is being examined under criteria both Mysterious and Arcane. Soon, if it passes High Level Review by our Gnomes, it will be released.
The most common reasons that a post is held are that it was made to a Really Old Thread or it contained a Whole Lot of URLs.
nl2br() is your friend
http://www.php.net/nl2br
a another easy solution is:
to change all html tags in the body string to *
eregi_replace
As ‘domain’ said – use nl2br() in php. You could insert it at the engine-level or the template-level.
hello,
sorry, but what is nl2br ? for what is this?
greetings
Mike
how does it work ?
Using nl2br(), a php function that converts newlines to HTML line breaks.
Regards
i guess there is a plugin for it available
the hint don´t work with the nl2br function. give it other solutions for this?
thanks
Torsten
Thank you to all for the answers, you helped me a lot!
Text-control plugin solves the problem!
There must be a plugin available some where!
Karttie
xx