phpの関数を使用してHTMLの束をエコーアウトし、次のようなものにするのは悪い習慣ですか?
function my_function() {
global $post;
$custom_fields = get_post_custom();
$some_field = $custom_fields ['some_field'][0];
?>
<div class="something <?php if ($some_field) { echo $special-clas;} ?>">
<div class="something-else">
/* bunch more of html code */
</div>
</div>
}
そして、それをエコーするために使用したいページで?
<html>
<body>
.....
....
<?php echo my_function(); ?>
....
関数をエコーアウトすることがどれほど「受け入れられる」かわかりませんか?