views:

52

answers:

2

Is there a simple way (plugin / function) that uses Tidy or some other lib to pretty-print Wordpress's HTML output?

It's unreadable as it is and it's almost impossible to write a theme with proper indentation with all the includes / hooks going on all over the place.

Performance is not an issue as this only needs to be active for development purposes.

A: 

I suggest:

  1. Get Firebug
  2. Use PHP heredocs
  3. Include whitespace in your output using \n (newline), \t (tab), etc.
Ian Silber
I do have Firebug. Problem is not with stuff from variables but more of the way things from core Wordpress get included (eg. get_header(), get_footer()).
Andrei
A: 

WP-Beautifier sounds like it might do what you want.

Exactly ! Tried it and it's great !HTMLTidy for Wordpress: http://wordpress.org/extend/plugins/htmltidy-for-wordpress/, mentioned in an answer that the answerer deleted, is great too, although I prefer what WP-Beautifier does (removing comments, etc.).
Andrei