When I was researching the upcoming features for WordPress 2.9, I came across the following: “Add support for ‘include’ and ‘exclude’ to (Gallery Shortcode)”
I didn’t know what the gallery shortcode was all about so I looked into it and was pleasently surprised to discover a built-in WordPress feature that allows you to display a simple image gallery on a post or page.
The gallery shortcode will display all of the images that you have uploaded to that post or page as thumbnails. Here’s how you do that.
- Upload an image using the upload/insert button for the post or page where you want the images to display.
- Save the upload but don’t insert it into your post or page.
- Do this for each image that you want to display.
into your post or page where you want the gallery to be displayed.
The gallery will look like the following:
These are all photos of my favorite soccer goalie, Iker Casillas, who plays for Real Madrid. He has nothing to do with this post but I needed images for this article and he is one of my top ten celebrity crushes. ;-)
The gallery shortcode has a number of options that can be added to it. Some of them are:
- columns – You can specify the number of columns for the image display
- id – This will display images attached to a specific post. For example, the gallery above displays the images for this post but by using the post id number I could display the images from a different post in this one.
- size – will set the size of the images. The default is thumbnail but you can also use the medium and large images.
Obviously, this is not as full features as a gallery plugin like NextGen Gallery but for a quick and easy gallery on a post or page this shortcode works great.
I just can’t believe that I was completely clueless about it until recently.
If you want to read more about the gallery shortcode, there is information in the codex.
photo credit: voteprime