Enhancing Your WordPress Gallery

In: WordPress Tutorials - Intermediate

enhanced use of WordPress gallery

I’ve posted previously about the in-built gallery feature of WordPress,and some of the simple things you can do using the shortcode. With this post I wanted to share a few more tips and some apparently less well-known features such as using multiple galleries on one page.

Multiple Galleries In One Page/Post

In WordPress terms, when you upload images to a specific post, those images are attached to the post and become part of the default gallery for that post which you can insert into your post from the media uploader.

Basic WordPress Gallery

If you only use the media uploader, it would appear that you can only insert one gallery per post – the images you’ve attached to that specific post. But what if you want to include multiple galleries in one post? It doesn’t seem possible using the standard media uploader, but if you use the gallery shortcode you can do it easily. (I describe the basic use of the gallery shortcode here)

1) First you will need to know the ID numbers of the images that you want to use. The easiest way to do this is add a plugin called Reveal IDs  This is a very handy plugin that adds a new column to the WP dashboard showing IDs for posts, pages, media etc.

2) After installing and activating the plugin go to Settings > Reveal IDs and make sure “Show Media IDs” is checked.

3) Next go to your media library and you will be able to easily locate the images you want to use and find their respective IDs.Write down the IDs (unless you have a photographic memory ;) ).

Media Library Showing Image IDs (Reveal IDs Plugin)

4) Go back into editing your post where you want to place your additional gallery. Then simply type the following shortcode to add those images as a gallery:

[ gallery include="637, 636, 635" ]

Multiple Galleries in a WordPress Post

Other uses of the shortcode:

1) If all of the images you want to use are all attached (i.e. part of that post’s gallery) to another post, you can insert them using the ID of that post:
[ gallery id="123" ]

(where 123 is the id of the post)

2) You can also exclude certain images from appearing in your gallery:

[ gallery exclude="21,32,43" ]

Other Gallery Enhancements

Linking Each Image To A Specific URL

By default you can link the images in your gallery to either the file itself or the attachment page for that image. If you link to the file it will simply open the image in a browser window by itself.

WordPress Gallery - link to image file

The attachment page is like a stripped down post page which displays the image within the context of your theme and allows people to leave a comment.

Image Attachment Page in Twenty Eleven WordPress Theme
What if you would like to link each image in the gallery each to a diffent location such as an external website, or other pages on your site? Well you need a plugin to do that. WP Gallery Custom Links is a small plugin that allows you to do this very thing. It adds an additional field for you to specifiy where that image should link to from the gallery.

wp gallery custom links plugin

Using A Lightbox to Display Your Gallery

If you would like your gallery to open up in a lightbox or slideshow you can add one of an infinite number of plugins to do this. I happen to like Simple Lightbox or Lightbox Plus. You can also activate the Carousel feature in Jetpack to display images as a nice slider. If you are using Simple Lightbox, you will find the settings on the Settings > Media page where you can activate and configure the plugin.

One thing to be aware of when using a plugin like this is that you will need to upload large sizes of your images and insert them into the gallery as thumbnails, in conjunction with using the link to file option. So when you insert the gallery on your page, you will see thumbnail images, but when you click on them, a larger version will open up  in your lightbox or slideshow.

Open WordPress gallery in a lightbox

header image: http://www.flickr.com/photos/alttext/298812490/


I hope you found this post useful. If you enjoyed it, consider signing up for updates via email. I help entrepreneurs and businesses learn how to use WordPress - with patience and hand-holding, I turn technophobes into technopros. I also help businesses develop an effective online marketing strategy and compelling web presence.

Comment Form

Weekly WordPress Tips

+ Discounts on Classes & Products

How I Can Help You

Hi! I'm Lucy Beer. I believe that technology is liberating when you know how to use it, and bewildering when you don’t. That’s where I come in. I help non-techies understand and use the web to empower their personal or business mission. I'm here to share with you everything I've learned (and continue to learn) about WordPress and online marketing. Whether you need to build a website, optimize your existing site, or create a marketing strategy that works, I'll help you understand, in plain English, what you need to do to achieve your goals.

Upcoming WordPress Classes

IN-PERSON CLASSES

Build an Email List - Using Mailchimp with WordPress
May 15th, 7:30pm - 9:30pm
$40

Ecommerce with WordPress: Sell Products and Services
May 29th, 7:30pm - 9:30pm
$40

Learn How To Get Targeted Traffic To Your Site

Let’s Talk On Facebook

Socialize

Services I Use & Recommend

Sucuri
WP Engine
BlueHost
Gravity Forms
Siteground Hosting
WPMU
  • LucyBeer: The testimonials plugin I reference here has ways you can organize testimonials. For example you cou [...]
  • Alan Little: Hey Lucy, posting testimonials for a site generally seems easy enough, but how to gather testimonia [...]
  • LucyBeer: Yep - it still functions just like a regular gravity form would, so site admin can still receive the [...]
  • Gregg: Within Gravity Forms can a notification be setup to let the admin of the site know that there is a n [...]
  • LucyBeer: Nice!! Glad to hear it! [...]

Login Status

You are not currently logged in.






» Register
» Lost your Password?

May 29th Class : Ecommerce with WordPress - Sell Products & Services REGISTER NOW

Hosted by WPEngine