I’m studying TwentyTen, under the assumption that it contains the best practices for writing themes and modifying them using child themes.
I’m noticing what looks like a really redundant practice, which is to overload not the base template file (eg: attachment.php) but instead to overload the template-part file (eg: loop-attachment.php).
Can someone explain the benefit of this approach? If you look at attachment.php, for example, inside TwentyTen, it’s really nothing more than a shell – gets header, creates some divs, then calls the REAL attachment file using get_template_part – then displays the footer.
And then if you look at single.php, it’s almost exactly the same deal.
I can understand wanting to define an outer structure once, and then using different parts of the loop as internals, but that’s not what TwentyTen is doing, since it redefines this outer structure over and over in all these different template files.
Can someone either confirm that the approach taken in TwentyTen is overkill and just obfuscates theme overloading, or point me to some good examples where this technique can actually make your life easier. Right now I’m feeling I should ignore the whole get_template_part thing, and just overload the base template file.
Thanks!