Ever since about WordPress v2.6 or so, images you uploaded and inserted into a WordPress post were created as attachments, a sub-post type that belongs to the post or page they are attached to. These attachment posts can be given their own template, and indeed they look for one when you visit the attachment’s permalink. The K2 theme ships with image and attachment templates (named image.php and attachment.php in the theme template hierachy) and displays the file along with some meta data and, if the image is a part of a gallery (or there is more than one attachment on the post), navigation aids to move from one attachment to the next. For many sites this is ideal, but if you want to just give people the file, and avoid having to create these attachment templates, then here’s a neat trick I cooked up on a recent project.
Continue reading ‘Image/Attachment Templates for WordPress’
Tag Archive for 'themes'
You gotta love the GPL.
All of the code I release is done so under the GPLv3 license, including my WordPress plugins. Because of this, my K2 Hook Up plugin inspired a very similar plugin for the premium theme, Thesis. This is why I love open source. I’m free to copy and paste and tinker and hack. So when I’m fortunate to offer up my own code for others to use, its a great feeling to have it in turn inspire another’s tinkering.
But its an even better feeling to receive a very nice complement on your contributions:
I’m very grateful for your plugin, Eric! Seems like whenever I try to do admin panel stuff, it’s so complex, leading to surrender on my part. Your plugin was very well written — elegant in its simplicity, as they say — and helped me learn some stuff! – Rick Beckman
Its interactions like this that really do make it all worthwhile.
I have just committed a major update to my K2 Hook Up plugin. As soon as I released my plugin—which allows smart people using the K2 theme to insert arbitrary HTML, CSS, or JavaScript code into any of the 7 custom template hooks that K2 provides—I got the same question: When will it support inserting PHP code?
I’m happy to report that its day has come, and that day is today.
A little surprise I wasn’t expecting… I recently upgraded to Wordpress 2.3 and K2 Release Candidate 1, a popular theme framework for WP.
After I upgraded, the K2 Side Bar Manager had a new module to drag over. The Tag Cloud. Neato.
comments