I have seen many questions from people about how to create photo galleries in WordPress. But often I see these questions answered by somebody recommending a plugin or something like that. You don’t really need plugins to create photo galleries. WordPress has a huge amount of gallery functionality built right in. You just need to make your theme smarter in order to take advantage of it.
Note: Matt has one of the neatest photo gallery implementations around, and he often gets questions about it. So I’m going to refer to it from time to time in this post. Maybe you’ll want to head over there and familiarize yourself with some of the look and features of it.
Understanding the Gallery Concept
One of the first things you need to know is how WordPress organizes Galleries. A gallery is really just a post with a bunch of images attached to it.
While editing a post or creating a new one, you have the option to upload images or other files. When you upload a file through the file Uploader, WordPress creates a post just for that file. This post has a post_type of “attachment”. Images in particular get some extra processing, and they show up in multiple sizes, you can insert them into the posts, etc. You probably already knew that. You probably have seen the gallery inserter, which just inserts the “gallery” shortcode into your post.
What you might not have known is that it’s doing more than you think. It’s not just resizing those images you’re uploading, but it’s pulling out metadata and other information about the image too. It’s grabbing alot of the EXIF data from the image and storing it as postmeta items for that attachment post. The post itself, being a post, gets its own URL, which is the post that it is attached to’s URL followed by the attachment posts title. Basically, an attachment post is sorta like a child of the parent post, which contains the gallery. So all a gallery really is is the sum of the attachments posts that are children of the gallery post itself.
- A Non-Violent Activist Dies in Texas (online article)
- Are Police Taking Sides in Protests? (online article)
- Artwork, Stories and Photojournalism
- Austrian Party with Nazi Imagery Wins Big (online article)
- Devil’s Spit (short story clip)
- For Better or Worse (short story – online)
- Miss Patel’s Holiday (short story clip)
- Notes from the Obama Rally (Nov. 12, 2007)
- Remembering David Bowie (short story clip)
- Sari Sari (short story clip)
- The Media as Theater of War
- Travel Journal
- A New Yorker in Belize
- Belize: Hol Chan Marine Reserve and Shark Ray Alley
- Belmar Beach after the Storm – 2009
- Christmas in New York (2005)
- Civilization in the Jungle: Mayan Lamanai Temple
- Fruit and Flowers in the Garden State
- Jones Beach Airshow
- Protest at the UN: No to dictatorship, yes to democracy in Iran
- San Francisco 2005
- Wintery Wall Street – 2009
- Zombies at the Jersey Shore – 2009
- Two Visits to a Fast-Changing Lebanon (online article)
- Wahhabism, Saudi Arabia, and Their Gift to Yale | Omer Aziz
- Welcome to the Jungle (short story – online)
- What Would Teddy Do? (short story – online)
- RT @ProfFeynman: Have no respect whatsoever for authority; forget who said it and instead look what he starts with, where he ends up, and a… 50 minutes ago
- RT @aronlund: For some hard numbers on Moscow's humanitarian generosity: Russia provided about one tenth of one percent of total aid fundin… 4 hours ago
- RT @artistkandinsky: Landscape with a steam locomotive #vasilykandinsky #kandinsky https://t.co/W8wRMNTUg9 4 hours ago
- RT @donhertzfeldt: https://t.co/pzOL3K4Be6 4 hours ago
- PR Firm Tied to CAIR Linked to Sliming of Maajid Nawaz meforum.org/islamist-watch… 5 hours ago