Separating Post Formats in Twenty Ten Child Theme for Easier Additions and Edits

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:

Continue reading “Separating Post Formats in Twenty Ten Child Theme for Easier Additions and Edits”

I See get_template_part in my WordPress Theme. What's it For? How Do I Use It?

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.

Continue reading “I See get_template_part in my WordPress Theme. What's it For? How Do I Use It?”