Post-Release Theme Fixes

Once again, this is just another post letting everyone know that my themes, including Sandbox, have been updated. I hadn’t properly tested the new gallery short code in WordPress 2.5 and therefore my themes didn’t work too well with it, since the default gallery short code inserts a style element within the body. Not good. The gallery short code is now handled properly by each theme.

There was another significant change. For single posts that are actually attachments, WordPress looks for a template file in the theme directory that makes the abbreviated mime-type. For JPEG image (image/jpeg), WordPress will look for a template file named image.php in the current theme directory. If that file isn’t present, it then looks for attachment.php and then falls back on single.php. So each theme includes a new file, image.php. The general attachment file remains and was modified accordingly.

For Sandboxers, the relevant revisions from version 1.5 to just-released version 1.5.2 are 247, 248, 249, 250, 251, 252, and253. That’s your changelog for the most part. Enjoy the themes.

Comments

  1. adam wrote:

    I saw that image.php. I’m a little surprised it wasn’t mentioned before the release, especially with there being a dedicated “theme compatibility” page in the codex.

  2. adam wrote:

    I wonder if there are other mime-type templates that also work?

  3. Scott wrote:

    Yes. I played around a bit with possible file types. Yes, you could have a video.php theme file for .mov attachments, audio.php theme file for mp3 attachments, and so on. You could have a text.php for plain text files you’ve uploaded.

    Check out the get_attachment_template function in wp-includes/theme.php. It’s similar to the mime-type function in the Sandbox theme (for attachments!). Very similar. ;-)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*

*