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
- BBC News - 'The story of a weird world I was warned never to tell' bbc.com/news/stories-4… 16 hours ago
- Are Humans Really On The Brink Of Achieving Immortality? via @IFLScience: iflscience.com/technology/are… 17 hours ago
- 3 of 5 stars to The Parent Trap by Vic Crume goodreads.com/review/show/23… 1 day ago
- gucci models carried their own severed heads down the runway i-d.vice.com/en_uk/article/… via @i_D 1 day ago
- International Relations studies - What's wrong and how to fix it. foreignpolicy.com/2018/02/20/ame… 1 day ago