Is it bad practice to echo out a bunch of HTML using a function in php and having it something like this:
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> } And then in the page where you want to use that to echo it?
<html> <body> ..... .... <?php echo my_function(); ?> .... I'm unsure how "accepted" it is to echo out functions?
echoin that situation is superfluous. Your function doesn't return a string, it outputs the data directly. As regards "bad practice" - not in and of itself, but it depends how you use it.