2 posts ago I sort of skimmed this topic and while I got just one response I figured my post was vague enough for a do over.
That post wasn’t intended to be a How-To post but more of a heads up. I had not found any reasonable documentation of how to use image.php,myself. Matt Mullenweg showed us how to use the uploader but didn’t mention image.php. But I did find out that it is very easy to use. Easy is your good friend.
So if you are confused about how it works and what the heck image.php does and how it all comes together to show a gallery similar to Matt’s. I think I can help some people and confuse a few others. Just kidding.
Just a tidbit: image.php is like attachment.php.More on that later.
Caveat:Matt’s main photo page has fancy pagination- a whole other deal- and not a weapon in my arsenal, sorry.***It’s Gallery2***
My how-to will deal with image.php and how it acts to display the gallery.
The first thing to do is get a copy of *image.php and I would offer it right here but that might not be kosher so please get it from the Default WP theme that came with WP 2.5 in the folder wp-content/themes/default. If you are like me you might not have updated your wp-content folder when you upgraded and so the new file isn’t on your server,yet. Just upload it to the theme folder you are currently using.
*Image.php is similar to attachment.php another “newish” template file that older themes don’t usually have. Most themes, if not all, released right now don’t have image.php,either.
WP themes usually use the same names for html in page.php and index.php, etc so you might not have to correct the div names at all. But if you find image.php doesn’t “look right” there’s a problem and you will have to edit the div names to match the ones your theme uses.
I am interested in releasing my latest theme for anyone to download so I have recently learned the value of using the same div names that everyone else uses.
Enough of the preamble, where is the tutorial?
You can put galleries in pages or posts.
Assuming you haven’t yet created a new page for your gallery the 1st thing to do is go to Write> Page in the WP dashboard and create a new page. If you want to use a post you can use a post.
In the post editor page click on the add media icon and a lightbox will open with the upload options.
To upload multiple images press upload and click on/select a batch of pictures by holding down your keyboard control key and clicking on the images you want to upload simultaneously.
You will see a Crunching message. Once the image has uploaded it will show as a tiny thumbnail and the link to show the larger thumbnail. I’ve found it’s best to just upload and insert the gallery rather than try to deal with titles captions and descriptions after uploading. You can do that later by going to Manage>> Media Library.
Or you can go to Manage>>Posts/Pages and click on the post you want to edit and then click on add media then click on gallery and you’ll be shown only the iamges for that page or post.Phew.
You can also edit the image titles and descriptions on the spot by clicking the edit link when looking at your gallery…
If your thumbs look chopped off at the top and bottom,go to Miscellaneous and find the check box for cropping thumbs.But this will only effect new images uploaded,older images will look chopped off.
That’s it. Really. ***spoke too soon,scroll down***
***There are problems with the gallery! You will need a plugin to get posts or pages with a gallery in them to validate.****
Here is a link to a plain text file with my very minor changes to image.php and some css you can use as head start.
Mine is pretty bare bones feel free to make it so much more awesome.
One last thing is archives won’t display images so your archived posts may look strange if they just have galleries in them…seems to show the gallery css instead! This is why it might be better to use a page,instead of a post.
Just a thought.