So far in this little mini-series, we have learned how to add in new post formats to our twenty ten child theme. We have set up meta boxes to enter in a URL for our Link post format. We have split out our formats to individual templates, and we set up our new link format in it’s own template, and made use of the URL to link the title of the link post format to the original article. But what if someone visits our site and comes directly to the single post view of the link post? Our edits so far have only affected the index/blog view (and archives). Well today we will get that link added in to the single post view. Check it out!
Category Archives: Post Formats
Putting Our Meta Box to Use In Our New Link Post Format
If you’ve been following along with this little series at all, you now that over the past several posts, we’ve looked at adding in custom meta boxes to be able to input a URL for our link post format. And we looked at how to split out our post formats to make it easier to edit existing ones, and add new ones. Today we will make use of the custom meta box, by actually taking that URL you can input to the meta box from your post screen and applying it to the title of your post, so that rather than the title linking to the articles permalink, it will link to the original article you are referencing.
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:
Custom Styling for Our Post Formats On Our Child Theme
This is pretty much the last step in getting our child theme set up. As in the basic styling. Before I start to dig in and see what I can accomplish, I had to take care of the basic styling. So we have a pretty complete child theme, and we’ve gained some real useful knowledge on how things work. Let’s just take a look at one last thing, let’s get those post formats styled. We recently learned how to add in all of the post formats to our child theme if we wanted to, but now we want to make them really stand out.
Additional Post Formats For TwentyTen Child Theme, And Post Formats in General
EDIT: I recently found out a better way to add post formats to a Twenty-Ten child theme, scroll to the bottom of the post to check it out!
As we announced yesterday, WordPress 3.1 was released. Hopefully you have all upgraded by now. If not, get to it. Remember to always keep your install up to date with the latest release. Not just for the cool new features, but for security too. Anyway, if you recently upgraded to 3.1, you may be asking yourself the same question as I see others asking. Where are my post formats? WordPress 3.1 promised lots of different post formats, where are they? Let’s answer that question and tell you how to get them going if you don’t have them.