Skip to content
Mar 31 / Anamaria

WordPress 2.5 image gallery & Fauna

Fauna image gallery

One of the features I really love in WordPress 2.5 is the built-in gallery function. I was pretty disappointed though, that my first attempts at using this function did not look half as good as the ones on Matt’s site. Specifically, my individual image pages didn’t have the thumbnail navigation to get the to the next and previous images and the photos on the individual pages were tiny.

A bit of sleuthing revealed the solutions. I found out that the individual image gallery pages look for an image.php template.  Also, these pages use the medium size image created when you upload images into the WordPress media library. Therfore, my first step in getting my galleries looking they way I wanted them was to go to Settings>Miscellaneous in my WordPress admin to change the size of my medium images.  I used 730 pixels as the maximum for both width and height.

After changing these settings, I turned to creating my new image.php template. I use the fabulous Fauna theme and decided to take a stab at making the necessary modifications to that theme, as I wanted to continue using it. I used single.php as my starting point, and following instructions I found on the Fauna support group, I created a single column Fauna image template. I added the code from template-post.php to my file and then copied the navigation code from the default theme’s image.php file. I also tried to strip away the code that was not necessary. After some trial and error, I ended up with an image.php Fauna file. I am sure that there was certainly a more elegant way of doing this, but given that my main PHP skill is copying and pasting, I was pretty pleased to have gotten this far. A couple small changes to my stylesheet ensured that everything looked as it should.

My last hurdle came when I upgraded WordPress from RC1 to the final version. All of a sudden the thumbnails on the main post page started to have spacing issues. What had formerly been tidy rows of three thumbnails were now strangely spaced alternating rows of two and then one thumbnail. I am not sure what changed between RC1 and the final version, but I found that commenting out the rules for the dl, dt and dd tags fixed this problem. I am sure this will break something in some other part of the site, but I guess I will deal with that when I come to it. For now, I am just happy to have my Fauna galleries working. You can see an example here. I have a few more things I would like to add to the gallery templates, but those will have to wait until another day.

Leave a Comment