You can solve it with creating a custom function inside "functions.php":
function indented_wp_head(){
ob_start();
wp_head();
$header = ob_get_contents();
ob_end_clean();
echo preg_replace("/\n/", "\n\t", substr($header, 0, -1));
echo "\n";
}
Now you just need to call this function in the "header.php":
<head>
<!-- ... -->
<?php indented_wp_head() ?>
</head>
If you want to use it for wp_footer()
too, you can create this function for general usage in "functions.php":
/**
* Indents the output of
* a function
*
* @return void
*/
if (! function_exists("print_indented")) {
function print_indented($fn)
{
ob_start();
call_user_func($fn);
$html = ob_get_contents();
ob_end_clean();
echo preg_replace("/\n/", "\n\t", substr($html, 0, - 1));
echo "\n";
}
}
And call it in "header.php" or "footer.php" like
<?php print_indented("wp_footer") ?>
<?php print_indented("wp_head") ?>