html br tags
-
I didn’t post this correctly. The problem is that wordpress is adding <br> tags to my html code even though I have rich text editing turned off.
How can I eliminate the added <br>s from my code?
I have the same problem. And I found a 3-year old forum post with the same question, and no answers. ??
Okay, I figured out a scary hack: edit /wp-includes/functions-formatting.php to remove all but the last line of the wpautop function, so it ends up looking like:
function wpautop($pee, $br = 1) {
return $pee;
}It does really seem like there should be an easier way, though.
I had the same problem and spent about 6 hours trying to figure out the problem. chronodm’s hack works well. In addition to chronodm’s hack, I also
changed clean_pre function intofunction clean_pre($text) {
$text = str_replace(‘<br />’, ‘\n’, $text);
$text = str_replace(‘<p>’, “\n”, $text);
$text = str_replace(‘</p>’, ‘\n’, $text);
return $text;
}This is ridiculous. One shouldn’t have to hack like that to get the most simple basic functionality.
This puts WordPress way behind other products at a time when there are claims to wanting to use WordPress for the Enterprize. If an unresolved request from many remains unanswered for over a year it is an example of no support whatsoever and no large organization should consider it.
The inability to turn formatting off and on is a serious liability.
I have a post on my WordPress install, “Because of the inability to turn off formatting on WordPress, you will have to go to my Movable Type site to see this demo.”
Basically that says it all.
There are quite a number of unresolved requests for this, and the fact that they are unresolved for over six months makes WordPress look a very poor choice, and one of several why I do not recommend it as a developer.
One would think that the developers would care????
It is absolutely essential to be able to turn formatting off and on to be any kind of serious contender in the marketplace. The inability to do so makes it unusable.
I was going to do the above hack, which is brilliant by the way, but it is needed to have this a choice, off or on. Movable Type and Expression Engine have had this from day one.
I wouldn’t even bother with WordPress, but it has the potential, and a lot of good people working with it, and has some plugins and functions that are terrific.
The apathy of the developers on this makes it much less usable for any serious development work though.
you lost me a while back in your rant, but have you considered pre? or code?
you never state what you are trying to do or why it’s important
I frankly like the formatting and have no use to turn it off. I have tried Expression Engine and find it unfathomable (I have a friend who swears by it). I happen to understand and like wordpress.
Seems like a simple hack to me that few would want but if they do, why not do it via a hack?
Bruce – as bestfoot pointed out, less rant and more info would be helpful.
What were you trying to do/show?
I would like to be able to make a post without wordpress adding any formatting whatsoever, Like one could with the older versions.
Thanks
@bruce21: sounds like a great opportunity to learn how to build your own plugin that does whatever-the-heck you want to posts in terms of stripping out formatting etc.
Or, you know, go use another blogging tool – but I can’t help suspecting that it won’t take you long to find something with that application that will have you leaving quivering posts of outrage in their support forum too. *Shrug* Some people are just like that.
The nice thing about WordPress is that with a little bit of ‘hey, I can do that myself’-ness, you can customize the hell out of it, and make it do pretty much what you want. Again, you can probably do the same with another tool, too.
It’s all about how you look at it.
VoodooLogic
- The topic ‘html br tags’ is closed to new replies.