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)
- Notes from the Obama Rally (Nov. 12, 2007)
- 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
- Stephen Hawking: Humans Should Ride a Beam of Light to Other Planets shar.es/1Btt6W via @SPACEdotcom 15 hours ago
- Dissertation on Early 20th-century Cairo Coffeehouses Leads Penn Ph.D. Student to Egyptian and British Spy Reports news.upenn.edu/news/dissertat… 15 hours ago
- Just posted a photo @ Great Sand Dunes National Park and Preserve instagram.com/p/BVoJ-tmghIT/ 16 hours ago
- Connectomics Explained by a Neuroscientist in 5 Levels of Complexity technologynetworks.com/neuroscience/v… 2 days ago
- Ten years in jail and 1,000 lashes: why we must defend Saudi blogger Raif Badawi | Andrew Brown theguardian.com/commentisfree/… 3 days ago