I want to write pure HTML in my posts!
-
I’m getting pretty fed up with WP2.2 and is seriously considering going 2.0 instead, even though I need the CMS capabilities of 2.2.
Here’s the thing: I want to write pure HTML in my posts and pages. That means no auto-linebreak-to-br-conversion, no p-tags and no nothing. To avoid the auto-br-thing I’ve modified
formatting.php
so that $br = 0 by default. This works like a charm for posts and pages. Only problem is, I want auto-br to be enabled in the comments and with my little hack that doesn’t happen.Here’s the code I’m talking about (from wpautop()):
// Begin pseudocode for wanted functionality: if(this_is_a_comment) { $br = 1; } else { // do nothing since $br = 0 by default) } // end pseudocode if ($br) { $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\")', $pee); $pee = preg_replace('|(?<!)\s*\n|', "\n", $pee); // optionally make line breaks $pee = str_replace('<WPPreserveNewline />', "\n", $pee); }
Anyone know how I can make this pseudocode into proper code? Or any other hacks for making this god-awful formatting on posts and pages go away?
EDIT: And yes, I know there’s a million threads on this and related subjects, and I’ve been through them all without finding a solution.
- The topic ‘I want to write pure HTML in my posts!’ is closed to new replies.