I hope someone here has a solution for a problem I'm having. I can't move forward with the project I'm working on otherwise, and I've been trying for about an hour.
I have a default Wordpress install, in which I'm creating my own theme. The very 'theme' of this theme, is that it's meant to be perfect in as many ways as possible. I love Wordpress, but I hate its default code indentation, as it makes things very messy.
What I am hoping to do, is find a method that will go through the generated source of a page before it is displayed, strip all instances of "\n" and "\t", then display it as normal.
I've found nothing online that is much help, except for one little function that goes at the top of the page:
This function simply finds all instances of "/>" and replaces it with just ">" at the end of a tag. That was made for somebody looking to make Wordpress validate to HTML Strict. Not something I want.
I've tried playing with it, to no avail thus far.
Another solution would be to create a script that edits Wordpress core files, removing all of the things I don't want. But that is a little messy, really.
I would also require that once the source has been stripped, further instances of line breaks and tabs would not be ignored, in any of the theme files.
I have a default Wordpress install, in which I'm creating my own theme. The very 'theme' of this theme, is that it's meant to be perfect in as many ways as possible. I love Wordpress, but I hate its default code indentation, as it makes things very messy.
What I am hoping to do, is find a method that will go through the generated source of a page before it is displayed, strip all instances of "\n" and "\t", then display it as normal.
I've found nothing online that is much help, except for one little function that goes at the top of the page:
Code:
<?php
function htmlize($buffer) {
return (preg_replace("!s*/>!", ">", $buffer));
}
ob_start("htmlize");
?>
This function simply finds all instances of "/>" and replaces it with just ">" at the end of a tag. That was made for somebody looking to make Wordpress validate to HTML Strict. Not something I want.
I've tried playing with it, to no avail thus far.
Another solution would be to create a script that edits Wordpress core files, removing all of the things I don't want. But that is a little messy, really.
I would also require that once the source has been stripped, further instances of line breaks and tabs would not be ignored, in any of the theme files.