How To Use The WordPress Gallery Shortcode

In: WordPress

10 Jul 2010

how to use WordPress image gallery shortcode

WordPress has an in-built image gallery feature which does not yet seem to be common knowledge even though it’s incredibly simple to use.

So let’s say you are writing a post that you want to include an image gallery in.

1)   Using the usual upload/insert image button, upload any images you want to include in the gallery BUT make sure to just click “Save All Changes” instead of “Insert Into Post.”

2)   If you want your gallery to have captions, make sure to fill in the Caption field when uploading your images.

3)   To display the images you just uploaded, simply use the shortcode:

[gallery]

You can type the shortcode in either the HTML or the Visual tab,  and it will automatically display the images you uploaded.

using the WordPress image gallery shortcode

Slightly more advanced options:

1)   By default the gallery shortcode will display thumbnails – at the size set in your Media submenu under Settings.  You can choose to display the images at Medium or Large sizes (again, according to the settings in your Media menu), or at the full size of the image. Just use the following format:

[gallery size="medium"]

2)   You can determine how many columns you want the images to display in by using this format:

[gallery columns=4]

This example would display images in 4 columns.

4)   If you want to show images that are attached to another of your posts, just locate the ID number of that post and use this shortcode:

[gallery ID="123"]

and replace “123” with the ID of the relevant post.

5)   Combine options in the following way:

[gallery size="medium" columns="2"]

6)   If you want to get fancy with it, you can style certain elements of the Gallery. See the Codex for more detailed information

The example gallery below features 3 images I uploaded, displayed as thumbnails (which I had set at 125×125) in 3 columns, and I assigned a caption for the first image.

Example of how to use WordPress gallery shortcode

**header image courtesy fionamclaren

If you like it, share it:


This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Responses to How To Use The WordPress Gallery Shortcode

Avatar

Gregg

July 27th, 2010 at 1:13 am

Correct me if I am worng but this is only availabel with WordPress.com not for self-hosted WordPress sites.

Avatar

LucyBeer

July 27th, 2010 at 1:17 am

No this IS available on self-hosted WordPress! The Codex link is included in the post above.

Comment Form

How I Can Help You

The goal of Web Training Wheels is to coach small businesses & entrepreneurs in internet marketing and strategy so that you can take a hands-on approach to your own online efforts.I work with people one-on-one or in small groups to provide the necessary coaching and education. I'll give you the confidence and tools you need to effectively use the web to expand your business and express yourself online. Find out more.

Are you in the Los Angeles area? Get customized training to suit your needs.

Blogging For Small Business Training Program
Customized 1-on-1 training program to get your small biz blog up and running with a strategy.

Social Media For Small Business Training Program
Customized 1-on-1 training program to formulate and implement a social media strategy for your business.

What Do You Need Help With?
Blogging For Beginners
Just starting out? Learn all the blogging basics

Learning Simple SEO Techniques
SEO made simple - I'll teach you what you need to know

Taking Your Site To The Next Level
Need to drive more traffic? Not sure how to increase your audience? Let's work together to get things moving.

WordPress Training
Get in-person help and training for WordPress

Sign up for updates and workshop info

Sign up to the email list and you will receive a free copy of my ebook "Practical SEO." I respect your privacy and your information will not be sold, rented or abused in any way. You will receive a weekly update of posts from the blog and, if you provide your location, occasional emails about events in your area.
join my mailing list
* indicates required field

Connect With Me

Where to find me and what to expect:

Email Me:
lucy [AT]webtrainingwheels.com

 

Discussions on WordPress, blogging, online marketing

 

blog updates, useful articles and tips

 


business networking

 


bookmark collection contains marketing resources for small business and non-profits

Ask A Question

Do you have a specific question or topic you'd like to have addressed on the blog? Shoot me an email with your inquiry and I might be able to write a blog post about it to help you out. lucy [AT] webtrainingwheels.com

OC WordCamp – April 24, 2010