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.
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 😉 ).
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″ ]
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.
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.
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.
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.
Similar Posts
Making Twenty Eleven Behave
The current default theme Twenty Eleven is generally a good starter theme for many bloggers, but it does have a couple of annoying quirks such as not placing a sidebar on single posts, even if you select it as your…
How to add FAQ Schema in WordPress using Yoast SEO
Many, many sites have an FAQ page. This is a page where a lot of frequently…
New Course: A Quick Introduction to CSS Grid Layout
CSS Grid Layout is the most powerful layout system currently available for web designers. Find out…
Beginner’s WordPress Class at Coloft, Santa Monica
Coloft is an awesome co-working space in Santa Monica. In addition to providing the physical space where entrepreneurs can work together, they also foster community and creativity. One of the value-adds they provide is Coloft Academy – an ongoing series…
Trust Is Fragile…Wherein Hootsuite Tests Mine
Trust is something that most businesses strive to develop with their customers/users/audience. Readers of Chris Brogan will know it’s one of his cornerstones and something he’s written extensively about. Trust has to be nurtured and maintained as a value that guides…
How to Easily Identify Fonts From Slogans
Nike has a super history about which I highly recommend you to find out more. It…