I'm creating a template, and one of the files is getting overloaded with pig-ugly mixed html and php.
At first I thought that maybe I should cut out chunks of the code, and call them using include().
Then I thought - maybe there is a wordpress way to do things. Perhaps I should abstract out my logic from the templates, by putting the custom loop in functions.php, and then calling it somehow from the template.
How do I do this?