Posted on 18 November, 2009 By Kim Woodbridge 17 Comments

WordPress Gallery Shortcode: Add a Simple Image Gallery to a Post or Page

 
Share

West Gallery entrance (by voteprime)

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.

  1. Upload an image using the upload/insert button for the post or page where you want the images to display.
  2. Save the upload but don’t insert it into your post or page.
  3. Do this for each image that you want to display.
  4. Add
    [gallery]
    

    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
    [gallery columns="3"]
    
  • 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.
    [gallery id="292"]
    
  • size – will set the size of the images. The default is thumbnail but you can also use the medium and large images.
    [gallery size="medium"]
    

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


Related Posts:
  • 14 Flickr Plugins for WordPress
  • NextGen Gallery Plugin for a WordPress Portfolio
  • 11 Photoblogging Plugins for WordPress
  • 7 WordPress Photoblog Themes
  • (Anti) Social-Lists 3/28/10
  • Posted In : WordPress Tips
    If you enjoyed this post, please subscribe to my RSS Feed. You can also connect with my Facebook page or follow me on Twitter.



    17 Responses to “WordPress Gallery Shortcode: Add a Simple Image Gallery to a Post or Page”

    Trackbacks/Pingbacks
    1. 8 WordPress Shortcodes | (Anti) Social Development
    Leave a Comment
    You may use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

    CommentLuv Enabled

    Recent Comments

      • Ari Herzog: Agreed on the updates/inbox snafu. I rarely see page updates and I know where they are! .-= Ari Herzog´s last blog .....
      • jayson: Kim, Love the themes. I am looking to update the theme on my site to something more appropriate. My site is all abou...
      • vered: "I wish more people would use this. I think it’s silly when I get updates for things occuring in Kansas and California –...
      • Dennis Edell @ Direct Sales Marketing: I was speaking generally, not specifically this month. how exactly do you work things? .-= Dennis Edell @ Direct Sales M...
      • Lucy Beer: Unfortunately I think next to no-one actually sees those "Updates". They're buried in a subsection of the inbox and I do...
      • Kim Woodbridge: Hi Marbella - Thanks! I had a great time....
      • Kim Woodbridge: Hi Julie - I'll probably try kayaking again next summer but I don't know if I will become much of a kayaker - I had a di...
      • Kim Woodbridge: Hi Vered - If you ever get the chance, you should go. It's like a different world - it's so quiet and peaceful....

    About

    Kim Woodbridge is an accomplished Information and Technical Consultant specializing in the entire implementation of a WordPress based website including installation, theme design, upgrades, unique customizations and ongoing site maintenance.

    Wordpress Services

    • Installation, upgrades and maintenance
    • Conversion of existing html and css templates
    • Theme and plugin recommendations
    • CSS customizations
    • Troubleshooting and tweaks for unique situations
    • Customization for individual blogging goals and needs
    • Training and advice