Do you want to run a music or podcast site? Maybe you’ve already tried and have run into some problems. Or maybe you are just looking for some pointers to help your site out. I’ve run a series of posts on my personal site, Rev. Voodoo’s Blog, for nearly 5 years now. I have hundreds of DJ mixes over there and I’ve stumbled and reconfigured many times. This post won’t be a step by step tutorial, it might not even end up being very linear. I just figured I could brain dump a variety of things I have come across and maybe some of my learnings will be useful to you! Let’s dive in!
Our recent posts have all been in support of adding post formats in a twenty ten child theme. This post will have the same goal. There is really no way to easily add in another loop for a new post format in a twenty ten child theme. I thought about this for quite some time before settling on my solution. It is based somewhat on this write-up I made a while back. What we are going to do today is make a new loop.php in our child theme which uses get_template_part with the post formats to call to a format specific snippet of code. There will be no new code in the format files, I’ll just grab the appropriate portion of code from twenty ten’s loop.php, and put them in the right files. Our new loop.php will just be twentyten’s, with all the post display stuff removed, and a bit of code for calling the proper template part. The cool thing about this is it will let you easily add in different code for each format. There are a variety of ways to do this, but here’s mine:
I have seen quite a few searches come through lately for get_template_part. Seems like a lot of folks don’t know what it’s for, what it does, or how to use it in their WordPress theme. When it was introduced with WordPress version 3.0 I wasn’t all that excited. I didn’t see a need for it. I was kind of set in my ways. I liked how I did things. But after looking into it for a while, I discovered it’s a powerful and useful tool. Let’s take a look at what it does for you.